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-19-2007 07:09 AM
06-19-2007 07:09 AM
Just been looking into forum but couldn't find what I am looking for. I need to extract the content from a file that is between { } from any of these strings.
${C123QHOME}
${C12QHOME}
Or anything else between { } and drop that to a variable. I know that sed would do it but just can't start... any help?
So let's say ${C124HOME} would become C124HOME into a variable and then:
echo MYVAR
C124HOME
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2007 07:15 AM
06-19-2007 07:15 AM
Re: sed
${C124HOME}
# MYVAR=$(sed 's/.*{\(.*\)}.*/\1/p' infile)
# echo $MYVAR
C124HOME
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2007 07:36 AM
06-19-2007 07:36 AM
Re: sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2007 08:13 AM
06-19-2007 08:13 AM
Re: sed
cd ${C124HOME}
cd ${CAAHOME}
cd ${CAAQHOME}
I want to make sure I get only what could be inside ${***HOME}. All .profile files has that command :
cd ${***HOME}
ie.
cd ${CAAHOME}
or
cd ${CAAQHOME}
or
cd ${TCEHOME}
Tks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2007 08:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2007 08:49 AM
06-19-2007 08:49 AM