sh file if statement for user input Y/N
Posted on 2011-02-13
Hi i have created an sh script and need to create an if statement for user input Y or N,
i have tried the following
echo -n "Do you wish to move this file to the tmp directory?[Y/N]: "
if [$movefile == Y]; then
echo "Moving File to tmp"
echo "you can download the file from "
please can someone correct this for me as when i run the script i get the responce
Do you wish to move this file to the tmp directory?[Y/N]: Y
./search_with_ref_input.sh: line 19: [Y: command not found
you can download the file from
thanks in advance