Computing.Net > Forums > Unix > Shell Scripting

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Shell Scripting

Reply to Message Icon

Name: martint
Date: April 26, 2005 at 21:46:23 Pacific
OS: Red Hat 9
CPU/Ram: 256
Comment:

Need help to write a shell script that accept any filenames as arguments and return the newest file from the list.



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: April 27, 2005 at 05:33:33 Pacific
Reply:

Give it a shot. Post what you have done. Ask questions about the parts you have trouble with.


0

Response Number 2
Name: Luke Chi
Date: April 27, 2005 at 09:48:04 Pacific
Reply:

ls -lrt file1 file2 file3 ... | tail -1
or
ls -rt file1 file2 file3 ... | tail -1

Luke Chi


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Help with tar and gzip fi... difference in time



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Shell Scripting

Shell Scripting www.computing.net/answers/unix/shell-scripting/8475.html

Variables in Shell SCripting www.computing.net/answers/unix/variables-in-shell-scripting/6020.html

shell script to uninstall java www.computing.net/answers/unix/shell-script-to-uninstall-java-/5976.html