Quote:
Originally Posted by barakolshe
Hello, I am pretty new to bash scripts, I have written this simple script:
#!/bin/bash
flag = 0
for i in {1..9999}
do
if [ "$flag" -ne 1 ];
then
echo "im here"
fi;
done
But the script gives me an error which I don't understand,
the script just writes 9999 rows of this:
./dump.sh: line 6: [: -ne: unary operator expected
Thanks in advance for the help.
|
Again, as with your other post about scripting, you need to put your scripts into CODE tags, and you need to read the bash scripting tutorials you've been pointed to. Again, your error is VERY clear...it's telling you what line the error is on, and the fact that you're trying to perform an operation on something that wasn't defined. Same cause as your other post, same solution as your other post.