I have a script called idk.sh at the root of a folder called autograder. I also have a subdirectory in autograder called hw1 which contains some .sh files. I tried to print out the file name and contents but I failed. actually I tried /hw1, /hw1/, /hw1/* and failed. I dont really understand why I failed to fetch files and hope someone could answer me as I looked up the web and found that the approach should be /hw1/*. Thank you.
#!/bin/sh
for file in /hw1/*
do
echo $file
if [ -f $file ]
then
cat $file
echo $file
fi
done
~
~