LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-12-2007, 03:19 PM   #1
hopspitfire
LQ Newbie
 
Registered: Jun 2007
Distribution: Gentoo/FreeBSD
Posts: 7

Rep: Reputation: 0
Simple Scripting Help


I need to get a directory listing of all the perl scripts in /www and display them in the form of "Absolute Path" and "Last Time Accessed". There are a few commands I have been working with but none of them do what I need.

ls -dRlu $PWD/* - only lists the current directory, does not search recursively

awk '{ print $0 }' /www/findoutput-all.txt - findoutput-all.txt is a file with a listing of all the scripts, but I cannot get the output into 'ls'

Can you steer me in the right direction?
 
Old 06-12-2007, 04:09 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,999
Blog Entries: 5

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
ls `cat /www/findoutput-all.txt`

Note the above are back ticks rather than single quotes. Putting a command line in back ticks tells it to first execute that THEN use its output as the input for the original command (ls).

Above assumes you don't have spaces in your file names.
 
Old 06-12-2007, 04:46 PM   #3
hopspitfire
LQ Newbie
 
Registered: Jun 2007
Distribution: Gentoo/FreeBSD
Posts: 7

Original Poster
Rep: Reputation: 0
That worked perfectly! Thank you, I completely forgot about the back ticks.
 
  


Reply

Tags
awk, scripting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple scripting help please kb100 Programming 7 08-23-2006 06:31 AM
simple scripting help please kb100 Programming 12 08-18-2006 08:34 AM
simple scripting help please kb100 Programming 3 08-18-2006 08:08 AM
simple scripting question wedgeworth Programming 6 02-04-2004 10:30 AM


All times are GMT -5. The time now is 01:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration