Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-26-2004, 04:38 AM   #1
LQ Newbie
Registered: Feb 2004
Posts: 29

Rep: Reputation: 15
Script Question

i'm just on a script wich queries with snmpget aund i get the full string like this back:
"enterprises. = 1073741824"
now my question is how can i take only the number after the "=" sign ? i dont want to make a temporary text file and sed the unwanted things out it would be perfect if someone could tell me how i can pipe the string after the equals into a new Variable...

plz help
Old 04-26-2004, 05:08 AM   #2
Registered: Mar 2004
Location: bursa
Posts: 110

Rep: Reputation: 15
Into a variable? Ok. I'll show you, but I don't know what snmpget is so I just use the echo command as an example.

MYNUM=`echo "enterprises. = 1073741824" |awk '{ print $3 }'`
Old 04-26-2004, 05:18 AM   #3
LQ Newbie
Registered: Feb 2004
Posts: 29

Original Poster
Rep: Reputation: 15
perfect ! it works .... jiiihaaaa thanks



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
script question lordofring Linux - Software 2 10-27-2005 01:15 PM
Script question yoderp Linux - General 8 07-06-2005 09:57 AM
Question on this script. Echo Kilo Programming 2 12-13-2004 05:20 AM
script question shanenin Linux - Software 2 04-04-2004 11:39 AM
Script Question blas Linux - General 5 02-14-2004 01:48 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:16 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration