this is not my ultimate goal, but I thought I should test this before
writing the full script.
I have a file of filenames.
file1:
dog
cat
fish
not I want to execute the following script;
I can't figure out why I cannot get the script to run without the error
message
the script:
1 #!/bin/sh
2
3 prefix="~/tempdir"
4
5 for filename in `cat dfiles`
6 do
7 TARGETFILE="$prefix/`echo $filename | sed 's/.*\/\([^\/]*$\)/\1/'`"
8 echo $TARGETFILE
9 cat $TARGETFILE
10 done
only line 10 seems to be the problem
the error message:
[schoi_d11776b] % compfiles
~/tempdir/dog
cat: cannot open ~/tempdir/dog
~/tempdir/cat
cat: cannot open ~/tempdir/fish
~/tempdir/cat
cat: cannot open ~/tempdir/fish
[schoi_d11776b] %
the strange thing is that I am able to perform
%> cat ~/tempdir/dog
on the command line just fine; it just doesn't like executing the
command in the script
ls -l for the file and directory says
drwxrwxrwx - for directory
-rwxrwxrwx - for the files
would appreciate your insights as to what i'm doing wrong
thanks
Sean