- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: want to extract field from output of cmd ls -l...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2007 08:09 PM
09-18-2007 08:09 PM
cmd ls -lrt *.vix gives out put like:
-rwxrwxr-x 1 symology symology 81920 Sep 19 09:00 STF.vix
Can i extract 5th field(no of bytes) from this
output. Basically i want to take this field in some var and through loop i want to count?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2007 08:13 PM
09-18-2007 08:13 PM
Re: want to extract field from output of cmd ls -lrt
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2007 10:40 PM
09-18-2007 10:40 PM
Re: want to extract field from output of cmd ls -lrt
do
echo $f
done
or
set -- "$(ls -lrt *.vix)"
echo $5
or
a="$(ls ls -lrt *.vix )"
b="${a#* * * * }"
b="${b%% *}"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2007 11:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2007 11:29 PM
09-18-2007 11:29 PM
Re: want to extract field from output of cmd ls -lrt
typeset -i g=0
ls -lrt | while read a b c d e f
do
echo $e $g
g=$e+g
done
echo $g
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:07 AM
09-19-2007 12:07 AM
Re: want to extract field from output of cmd ls -lrt
up:
ls -l | sort -rnk5
down:
ls -l | sort -nk5
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:21 AM
09-19-2007 12:21 AM
Re: want to extract field from output of cmd ls -lrt
Thanks a lot i got it.It is working fine.
Warm regard's