This is the error I get after compiling and running the file
./skript05.sh: 13: ./skript05.sh: Syntax error: word unexpected (expecting ")")
Here's the important snippet of the code, with line 13 pointed out. I don't think the rest of the code is needed since it works well, but if it is, let me know.
ls -l $1 | awk "
if($1 ~ /-([r-][w-][x-]){3}/)
{
MUCHLINES=$(system(\"egrep -o \"^[a-z ]{1,}$\" \", $9) | wc -l) ;#13
test -z "$MUCHLINES" && continue ;
print $9":"$MUCHLINES ;
>&2 echo "$9":"yes" ;
}
else >&2 echo "$9":"no" ;
"
What I can figure out is that it ignores symbols {} in lines 12 and 17, but I can't figure out why. All other parantheses are not ignored and highlighted properly when editing code in gedit for example.
I'm working on this in Linux.
I've been searching for answers on this for days, but can't seem to find any. If there are any, I'll apologize and delete this question. Thank you for any help!
(In case you need to know what is this code supposed to do - it should print into stdout "(nameoffile):(x)", where x is number of lines made up of only lowercase letters and spaces; and print into stderr "(nameoffile):yes/no" with yes in case of files (in ls -l known by having - as first symbol in access rights))
Aucun commentaire:
Enregistrer un commentaire