Search Results

Search: Posts Made By: mohtashims
21,846
Posted By mohtashims
@Rudic thank you for the input and it is...
@Rudic thank you for the input and it is certainly returning a single row however not the intended row.

If you look at the output when i pass 4 to get the 4th row it returns the 3rd row as the...
21,846
Posted By mohtashims
@Rudic sorry that was by overlook. With parameter...
@Rudic sorry that was by overlook. With parameter 3 the row returned should be the third row ie.
-rwxrwxrwx 1 user1 user 21624 Feb 11 17:13 httpd.conf_1581421456

Likewise when the user passes 4...
21,846
Posted By mohtashims
If the user passes 1 then i need the newest...
If the user passes 1 then i need the newest latest file.

If the user passes 2 then i wish to display only the newest - 1 file i.e second latest file.

if the user passes 3 then the third latest...
21,846
Posted By mohtashims
How do we display specific row of an output from bottom given line number?
I pass a number to my script. Passing "1" below.

./getfile.sh 1
echo "User entered: $1"
ls -ltr *.conf | sed -n '$p'
I wish to use ls -ltr i.e list files in ascending order of time the latest...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 05:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy