Theme
Primary Color
Lesson 25

Conditions With If And Else

الأوامر التي تم إستعمالها في الدرس

bash welcome.sh
welcome.sh
read -p "Enter Your Project Name: " project

if [ -z "$project" ]; then

    echo "Project Name Cant Be Empty"

else

    read -p "Create A Project ? yes/no: " answer

    if [ "$answer" = "yes" ]; then

        mkdir -p "$project/css" "$project/js" "$project/imgs"
        touch "$project/index.html"
        touch "$project/css/style.css" "$project/js/main.js"
        echo "$project Project Is Ready"

    else 

        echo "Creation Cancelled"

    fi
    
fi