Sponsored Content
Full Discussion: multiple variable question
Special Forums UNIX and Linux Applications Infrastructure Monitoring multiple variable question Post 302357938 by riegersteve on Thursday 1st of October 2009 03:14:53 AM
Old 10-01-2009
multiple variable question

This is the control File (snmplist.fl1)
.1.3.6.1.4.1.789.1.5.4.1.2.3 = STRING: "/vol/vol0/"
.1.3.6.1.4.1.789.1.5.4.1.2.5 = STRING: "/vol/SMP_sapdata/"
.1.3.6.1.4.1.789.1.5.4.1.2.7 = STRING: "/vol/SMP_saplog/"
.1.3.6.1.4.1.789.1.5.4.1.2.9 = STRING: "/vol/SRP_saplog/"
.1.3.6.1.4.1.789.1.5.4.1.2.11 = STRING: "/vol/SRP_sapdata/"


Code:
while read line; do VOL=`awk 'BEGIN { FS="[. ]" } {print $14}' snmplist.fl1`; OID=`awk 'BEGIN { FS="[. ]" } {print $17}' snmplist.fl1`; echo  echo -e "<31>\n   active = 1\n   name = DF Percent Free $VOL \n   oid = .1.3.6.1.4.1.789.1.5.4.1.6.$OID\n  thr = 10\n   oper =>=\n   sev = 4\n   strnum = 0\n</31>" ; done < snmplist.fl1

trying to get the last octet of each snmp line, and the "Vol Name"
and echo those two peices of data into a new line via the echo command

not happening,

would appreciate a hand,
thanx

Last edited by riegersteve; 10-01-2009 at 04:23 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

VAriable Question

hi there, In my shell script I'm using a variable $ICO to speicfy the type of file that I'm processing e.g. VFR = France. further in my shell I'm trying to programatically set the sql file thtat I want to run :- REPORTTXT=/tmp/$ICO3hr.dat however when I check the value (as below) :- ... (4 Replies)
Discussion started by: rjsha1
4 Replies

2. UNIX for Dummies Questions & Answers

Another variable question, I think

So seems only way I'm going to learn is by asking. In the following and I can tell you that $ENV=384: grep $ENV $TSH/ftp/some.files | while read ELABEL EENV EFILE RFILE do if ]; then rm -ef ${RFILE}* else rm -ef ${EFILE}* fi done In the some.files : ... (2 Replies)
Discussion started by: NycUnxer
2 Replies

3. Shell Programming and Scripting

variable question

Hi i have two question 1. Yahoo! In above there are total three words 1.1. www 1.2. yahoo 1.3 com how can i take all three things in different variable, i dont understand that how to separate dot. it looks like that a=www b=yahoo c=com 2. i have variable xyz whois value... (7 Replies)
Discussion started by: learnbash
7 Replies

4. Shell Programming and Scripting

Multiple variable in a variable in Perl

Hi All, I am trying to convert the below Csh while loop into Perl while loop but the problem is that in this csh script, i have 2 variables inside a variable -> $count is a variable {SB$count} as a whole is another variable. Csh is able to assign values to such variable like the below but i do... (3 Replies)
Discussion started by: Raynon
3 Replies

5. Shell Programming and Scripting

Logfile parsing with variable, multiple criterias among multiple lines

Hi all I've been working on a bash script parsing through debug/trace files and extracting all lines that relate to some search string. So far, it works pretty well. However, I am challenged by one requirement that is still open. What I want to do: 1) parse through a file and identify all... (3 Replies)
Discussion started by: reminder
3 Replies

6. Shell Programming and Scripting

Multiple variable substitutions

Is there anyway to accomplish this? (ksh) FILES_TO_PROCESS='NAME1 NAME2' SOURCE_NAME1=/tmp/myfile TARGET_NAME1=/somewhere/else # other file names for i in $FILES_TO_PROCESS do file1=SOURCE_$i file2=TARGET_$i echo cp ${$file1} ${$file2} <-- how do get this to work. done (2 Replies)
Discussion started by: koondog
2 Replies

7. Shell Programming and Scripting

need help using one variable multiple times

I apologize for the title but I am not even sure myself what to call this. I am going to use an example of a pizza delivery. I need to make an interactive script that allows users to order a certain number of pizzas, and then choose what they want on each pizza. Here is my code so far.... ... (1 Reply)
Discussion started by: cstadnyk1
1 Replies

8. Shell Programming and Scripting

Variable to command to Variable Question KSH

Hello, First post for Newbie as I am stumped. I need to get certain elements for a specific PID from the ps command. I am attempting to pass the value for the PID I want to retrieve the information for as a variable. When the following is run without using a variable, setting a specific PID,... (3 Replies)
Discussion started by: Coyote270WSM
3 Replies

9. Shell Programming and Scripting

Change Variable Value from Multiple Scripts and Use these Variable

Hi to All, Please find below details. file_config.config export file1_status="SUCCESS" export file2_status="SUCCESS" file_one.sh I am calling another two shell script from these script. I need to pass individual two script status (If it's "FAILED") to file_main.sh. file_main.sh I... (2 Replies)
Discussion started by: div_Neev
2 Replies

10. Shell Programming and Scripting

Variable with multiple values

Hello I need to alter a script to check for a flag file but there are now more than one type of flag file in my directory. Basically if any of these flg files exist then the MASK value should be set? Flag files to be included in assignment to variable e2e_scheduled*.flg COLL_STOP*.flg... (1 Reply)
Discussion started by: andymay
1 Replies
tbl(1)							      General Commands Manual							    tbl(1)

Name
       tbl - format tables for nroff or *roff

Syntax
       tbl [files...]

Description
       The  preprocessor  is used for formatting tables for or The input files are copied to the standard output, except for lines between .TS and
       .TE command lines, which are assumed to describe tables and are reformatted.

Options
       -TX     Produces output without fractional line motions.  Use when the destination output device or printer or  post-filter  cannot  handle
	       fractional line motions.

       -ms     Reads in macros prior to table formatting.

       -mm     Reads in the macros prior to table formatting, if your system has the macros installed.

Examples
       As an example, letting 	 represent a tab (which should be typed as a genuine tab) the input

	      .TS
	      c s s
	      c c s
	      c c c
	      l n n.
	      Household Population
	      Town	Households
	      	Number	Size
	      Bedminster	789	3.26
	      Bernards Twp.	3087	3.74
	      Bernardsville	2018	3.30
	      Bound Brook	3425	3.04
	      Branchburg	1644	3.49
	      Bridgewater	7897	3.81
	      Far Hills	240	3.19
	      .TE

       yields

		  Household Population
		  Town	       Households
			      Number   Size
	      Bedminster	789    3.26
	      Bernards Twp.    3087    3.74
	      Bernardsville    2018    3.30
	      Bound Brook      3425    3.04
	      Branchburg       1644    3.49
	      Bridgewater      7897    3.81
	      Far Hills 	240    3.19

       If  no  arguments are given, reads the standard input, so it may be used as a filter.  When is used with or the command should be first, to
       minimize the volume of data passed through pipes.

See Also
       nroff(1)
       "Tbl - A Program to Format Tables," ULTRIX Supplementary Documents, Vol. I:General User

																	    tbl(1)
All times are GMT -4. The time now is 09:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy