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.
Extracting the first file fromf ls
Name: prekida Date: July 13, 2005 at 14:38:21 Pacific OS: Sun Solaris CPU/Ram: 8/16G
Comment:
I need help in extracting first file only from an ls command and store it in a local variable I thought using awk we could build something - not very familiar how to do it
Something like ls -t $search_string and store the resultant first file alone into a local variable ( as my result will have multiple files )
Summary: Hi, I have file like this: ====================== 1232 asdasds: 121 wefefsedfsd asdsd !34234 sdfdf 43423 fdsfsd 423434 end =================== I would like to remove the first field which start wi...
Summary: Nish, If I am understanding you correctly, you just want the file extention for the last file in a directory assigned to a variable? In this case use one of the following: if you want the whole extent...
Summary: #!/bin/sh # run the 'ls' command with each outputted # item being read into the variable 'xx' ls|while read xx do # Check if the item is a regular file if [ -f $xx ] ;then # extract the first lette...