- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: strings
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
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
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
тАО11-21-2003 05:08 AM
тАО11-21-2003 05:08 AM
strings
version="5.9"
version="5.8"
version="5.7"
verison="5.6"
verison="5.5.1"
I always want to ignore the first number i.e "5" and print the rest of it without the digits and without the double quotes.
How do I do that?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:13 AM
тАО11-21-2003 05:13 AM
Re: strings
This is the new one.
These are my strings
version="5.9"
version="5.8"
version="5.7"
verison="5.6"
verison="5.5.1"
I always want to ignore the first number i.e "5" and print the rest of the number(s) without the PERIOD and without the double quotes.
How do I do that?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:22 AM
тАО11-21-2003 05:22 AM
Re: strings
assign a line to s$ and use
expr s$ : 'version=\"5\(.*\)\"'
if you want to read a file.
while read s
do
expr s$ : 'version=\"5\(.*\)\"'
done < file
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:24 AM
тАО11-21-2003 05:24 AM
Re: strings
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:24 AM
тАО11-21-2003 05:24 AM
Re: strings
assign a line to s$ and use
expr s$ : 'version=\"5.\(.*\)\"'
if you want to read a file.
while read s
do
expr s$ : 'version=\"5.\(.*\)\"'
done < file
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:32 AM
тАО11-21-2003 05:32 AM
Re: strings
if you want print
version=9
version=8
..
execute the attached script
TS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:35 AM
тАО11-21-2003 05:35 AM
Re: strings
But these strings are not in the file. This will the output of uname -r command
#uname -r
5.9
#uname -r
5.5.1
.
.
.
Sorry for the confusion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:39 AM
тАО11-21-2003 05:39 AM
Re: strings
then you can run
uname -r | sed 's/\"//g' file.out | sed 's/\.//g' | cut -c2-4
Hope this help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:40 AM
тАО11-21-2003 05:40 AM
Re: strings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:42 AM
тАО11-21-2003 05:42 AM
Re: strings
uname -r | sed 's/\"//g' | sed 's/\.//g' | cut -c2-4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 05:42 AM
тАО11-21-2003 05:42 AM
Re: strings
a little more detailed:
# echo $verison|awk -F. '{$1="";print$0}'
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 06:04 AM
тАО11-21-2003 06:04 AM
Re: strings
uname -r | awk '{print substr($0,3)}'
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 06:30 AM
тАО11-21-2003 06:30 AM
Re: strings
Also this case it is resolved with command awk.
uname -r | awk '{print substr($0,3)}'
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2003 06:36 AM
тАО11-21-2003 06:36 AM
Re: strings
# uname -r | awk -F 5. '{print $2}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2003 09:46 AM
тАО11-23-2003 09:46 AM
Re: strings
# uname -r | sed 's/^[^\.]*\.//'
Cheers,
JW.