• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need help writing an Unix AIX Script

jbloggs

Senior member
I have a text file 'myfilelist 'in a unix directory (/tmp) that has a list of files including full path , e.g.

/usr/file1
/mydir/file2
/myapp/file3

I need a script (Unix AIX) that will read each of those lines from the myfilelist file and do an ls -al for each one. How can this be done using unix script?

TIA
 
There's no such thing as "unix script" you need to pick a shell in which to write the script. Normally this is one of bourne (/bin/sh), C (/bin/csh) or Korn (/bin/ksh).
 
Originally posted by: Nothinman
There's no such thing as "unix script" you need to pick a shell in which to write the script. Normally this is one of bourne (/bin/sh), C (/bin/csh) or Korn (/bin/ksh).

I'm using /bin/ksh.

Thanks
 
Originally posted by: n0cmonkey
What have you got so far?

From looking around, I put together the following

for var in 'cat myfilelist'
do
'ls -al ' $var
done

This did not work as it gave me error that cat & myfilelist do not exist. I put the script in same dir as myfilelist.
 
Originally posted by: jbloggs
Originally posted by: n0cmonkey
What have you got so far?

From looking around, I put together the following

for var in 'cat myfilelist'
do
'ls -al ' $var
done

This did not work as it gave me error that cat & myfilelist do not exist. I put the script in same dir as myfilelist.

You don't want to use single quotes around "cat myfilelist." In fact, you don't want quotes at all. 🙂
 
Back
Top