- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell tricks
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
06-15-2005 04:53 AM
06-15-2005 04:53 AM
treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log
i need to strip off eveything after SCANTU.
how can i do this?
thanks!
Phil
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 04:58 AM
06-15-2005 04:58 AM
Re: shell tricks
Use "ls treasury*|cut -c1-22"
Enjoy :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 05:00 AM
06-15-2005 05:00 AM
Re: shell tricks
filename=treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log
newfilename=`echo $filename | cut -d"." -f1`
the newfilename shouldbe "treasury_server"
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 05:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 05:05 AM
06-15-2005 05:05 AM
Re: shell tricks
ls
if not
ls
if you have multiple file like treasury* you can put thw wildcard pattern instead of filename here as well.
hope it helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 05:35 AM
06-15-2005 05:35 AM
Re: shell tricks
x="treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log"
echo ${x%SCANTU*}
This will strip off the SCANTU also, but you could add that back on...
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 10:43 AM
06-15-2005 10:43 AM
Re: shell tricks
echo treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log | awk -F".1" '{print $1}'
enjoy!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 03:50 PM
06-15-2005 03:50 PM
Re: shell tricks
echo treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log | sed 's/SCANTU.*/SCANTU/'
echo treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log | cut -d '.' -f1,2
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 10:05 PM
06-15-2005 10:05 PM
Re: shell tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2005 02:08 AM
06-16-2005 02:08 AM
Re: shell tricks
Thanks for everyone who responded!
Phil