If condition not work regular in bash -


code

if [ $setup==="y" ]             echo "kurulum:"$setup         exit         full_dir=$full_dir"/public"     else     echo "sub-public folder exist? [public,web]"         read folder_extend         if [ $folder_extend ]                                 full_dir=$full_dir"/"$folder_extend         fi fi 

setup param $setup view "n" after run sh still condition firts part run. wrong code ?

thanks.

change to:

if [ "$setup" = "y" ]             echo "kurulum:"$setup         exit         full_dir=$full_dir"/public"     else     echo "sub-public folder exist? [public,web]"         read folder_extend         if [ "$folder_extend" ]                                 full_dir=$full_dir"/"$folder_extend         fi fi 

it should single =, , need spaces around it. should quote variables in contexts, in case contain spaces.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -