shell problem, command not found
Hi all, i'm having a problem at my problem about comparing 2 strings to last if.I'm trying to see if the first word of the file given as a argument is equal to 0 and if so to output a message.Here is my code and thanks in advance
#!/bin/sh if [ $# -ne 1 ] then echo "There are some problems with the parameters! Only one allowed!" elif [ ! -f $1 ] then echo "$1 does not exist or is not a valid file!" else mkdir Laborator cd Laborator echo "Make directory" # Make 10 files for i in 0 1 2 3 4 5 6 7 8 9 10 do echo > $i done cd - for i in `cat $1` ;do j=$(echo $i | cut -c-1) echo $j; if ["$j"-eq"0"];then echo "abcd" fi done fi |
You need spaces around your terms in the if statement
Code:
$ j=0 |
Thanks a lot suicidaleggroll.Problem solved.
|
All times are GMT -5. The time now is 11:36 AM. |