LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-26-2004, 04:38 AM   #1
blubbfish
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.231.2.10.2.2.5.4.10.1.6.4 = 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
rkef
Member
 
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.

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

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


 
  


Reply


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


All times are GMT -5. The time now is 10:04 AM.

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