- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: the sed command
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
Forums
Discussions
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
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
01-31-2005 08:27 AM
01-31-2005 08:27 AM
ls -ld /dev/vg_rdo1_s_rac_dbf0* | awk '{print $9}'
The o/p is
/dev/vg_rdo1_s_rac_dbf01/
/dev/vg_rdo1_s_rac_dbf02/
/dev/vg_rdo1_s_rac_dbf03/
/dev/vg_rdo1_s_rac_dbf04/
/dev/vg_rdo1_s_rac_dbf05/
/dev/vg_rdo1_s_rac_dbf06/
/dev/vg_rdo1_s_rac_dbf07/
I want to remove the last / from above output so i can run vgdisplay in loop. I would like to know how sed can be used to carry out this activity
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2005 08:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2005 08:41 AM
01-31-2005 08:41 AM
Re: the sed command
try
/usr/bin/ls -ld /dev/vg_rdo1_s_rac_dbf0* | awk '{print $9}'
-denver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2005 09:10 AM
01-31-2005 09:10 AM
Re: the sed command
for name in `ls -ld /dev/vg_rdo1_s_rac_dbf0*|awk -F\/ '{ print $X }' `
do
vgdisplay /dev/$name
done > outputfile.out
Where the $X is equal to the field number using / as a delimeter...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2005 02:01 PM
01-31-2005 02:01 PM
Re: the sed command
for i in `ls -d vg_rdo1_s_rac_dbf0*`
do
vgdisplay $i
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2005 04:45 AM
02-01-2005 04:45 AM
Re: the sed command
Rory
ls -ld /dev/vg_rdo1_s_rac_dbf0* | awk '{sub("/$","",$9)
print $9 }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2005 07:05 AM
02-01-2005 07:05 AM
Re: the sed command
Just do "l -ld /dev/vg*" instead of ls -ld .
Regards,
BL.
:)