hi all
i just have a quick question.
i am writing a script that will check the number of links for each file in the user's directory and output the appropriate message.
here it is:
#!/bin/sh
ls -l >outputfile
HERE IS MYQUESTION: how do I loop through each line of the file outputfile
for (...)
if $2>=2; then
echo "$9 has $2 links."
else
echo "$9 has one link>"
fi
done
thanks a lot
i just have a quick question.
i am writing a script that will check the number of links for each file in the user's directory and output the appropriate message.
here it is:
#!/bin/sh
ls -l >outputfile
HERE IS MYQUESTION: how do I loop through each line of the file outputfile
for (...)
if $2>=2; then
echo "$9 has $2 links."
else
echo "$9 has one link>"
fi
done
thanks a lot