- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: removing name in pathname
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
Discussions
Discussions
Forums
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
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
тАО04-25-2005 03:57 PM
тАО04-25-2005 03:57 PM
If i have this"
D/DIR1/DIR2/DIR3
D/DIR4/DIR5/DIR6
"
in a log file.. how can I removed the D to make it
"
/DIR1/DIR2/DIR3
/DIR4/DIR5/DIR6"
Best regards
Henry
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2005 04:13 PM
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2005 04:19 PM
тАО04-25-2005 04:19 PM
Re: removing name in pathname
I dun quite understand.. what do I have to do..if my log file is named "list".. then what should i do?
regards
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2005 04:23 PM
тАО04-25-2005 04:23 PM
Re: removing name in pathname
sed 's/D\//\//g'
Please note the backslash '\' is used to escape the forward slash '/'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2005 05:06 PM
тАО04-25-2005 05:06 PM
Re: removing name in pathname
sed -i 's/^D//' list
It will remove D in the begin and update it in to list file also.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2005 05:28 PM
тАО04-25-2005 05:28 PM
Re: removing name in pathname
My apologies but upon looking back into the displayed output of the one I posted, it looks confusing. I'll attach it as a word doc. What I suggested is using global string replacement in vi.
Regards,
Isralyn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2005 06:53 AM
тАО04-26-2005 06:53 AM
Re: removing name in pathname
D/DIR4/DIR5/DIR6
Correct me if I understand your question
incorrectly. My understanding is, you want to
remove all the chars from the beginning of the line
till the first '/' char. If that's what you want, the
following script should do it:
---
while read -r line
do
echo ${line#*/}
done < /your/logfile
--
- Biswajit
- Tags:
- variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2005 12:35 PM
тАО04-26-2005 12:35 PM