I’m writing a shell script and I’m doing
if ["$item0" == "$item1"]
then
echo match
fi
but it’s giving the error message “No such file or directory” on the line when run. The items above do contain file paths if that helps.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to note the spaces for between variables and the brackets, they matter. Also if
thenis on the same line asif, you need a;Corrected syntax:
P.S. if
matchis supposed to be a variable, make sure it’secho "$match"