LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 03: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, 04: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, 04:18 AM   #3
blubbfish
LQ Newbie
 
Registered: Feb 2004
Posts: 29

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


 
  


Reply



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 12:15 PM
Script question yoderp Linux - General 8 07-06-2005 08:57 AM
Question on this script. Echo Kilo Programming 2 12-13-2004 04:20 AM
script question shanenin Linux - Software 2 04-04-2004 10:39 AM
Script Question blas Linux - General 5 02-14-2004 12:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:05 PM.

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
Open Source Consulting | Domain Registration