When I try this simple script:
#!/bin/bash
#append csv
FILES= /home/stef/test/*
for f in $FILES do
cat $f >> ~/test.txt done
I get following error:
./append.sh: line 4: /home/stef/test/test2.txt: Permission denied.
What am I doing wrong?
Replace
FILES= /home/stef/test/*with
FILES=/home/stef/test/*The script is trying to evaluate the first match of /home/stef/test/*. It says permission denied because the file is not executable.
./append.sh: line 4: /home/stef/test/test2.txt: Permission denied.That’s line 4. Try with
FOO= *in a non-empty directory.And your
for ... do; donesyntax is borked as well,doneneeds a separator (;or newline) and so does “do“. That’s not what produces this erroe message however.