Unix Shell Script question

liunx

Guest
I'm trying to write a shell script tha takes a dir name and a file extention from the user, for example:<br /><br />~/mydir txt<br /><br />and returns the absolute pathname and filename and the specific permissions of that certain file, for example:<br /><br />/home/me/mydir/test.txt -rw-r--r--<br /><br />I'm very new to making shell scripts, here's what I have so far:<br /><br />for fileName in `find $1 -name '*'.$2`<br />do<br /> echo $fileName <br />done<br /><br />This returns the absolute path with the filename but I have no idea how to return the permissions on the file. How would I achieve this? Thanks to anyone for help.
</div>
 
Top