Sponsored Content
Top Forums Shell Programming and Scripting Getting values from a block into variables Post 302372165 by Franklin52 on Tuesday 17th of November 2009 07:40:43 AM
Old 11-17-2009
One way:

Code:
ipmitool bmc info | awk -v ORS=" " '/Aux Firmware Rev Info/{getline;p=1}p' | read var1 var2 var3 var4

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing and getting values of variables

suppose i have a file value where it returns 3 values a=1 b=2 c=4 when i run it. i am using this file in my shell script. how do i parse and get the value of a b and c? (3 Replies)
Discussion started by: Rekha
3 Replies

2. Shell Programming and Scripting

how to access values of awk/nawk variables outside the awk/nawk block?

i'm new to shell scripting and have a problem please help me in the script i have a nawk block which has a variable count nawk{ . . . count=count+1 print count } now i want to access the value of the count variable outside the awk block,like.. s=`expr count / m` (m is... (5 Replies)
Discussion started by: saniya
5 Replies

3. Shell Programming and Scripting

Assign values to variables of a file

Hi, I have a file like the following... CUST= DIR= NULIST= name=philps_123 How can i add values to each of these unassigned variables using a shell script? say for eg: i have values for CUST as onida, dir as /dir/onida, NULIST as /tmp/onida_files. How can i add these values to... (11 Replies)
Discussion started by: Tuxidow
11 Replies

4. Shell Programming and Scripting

How to use values in variables

Hi Legends, Please help me in solving the below: I have the file size and file name using `ls` and awk command. ls -ltr *.pf |awk '{print $5, $9}' 2000003072 ABC.pf 2000003072 DEF.pf 2000003072 GHI.pf 56000588 JKL.pf 2000003072 MNO.pf 2000003072 PQR.pf Now, I want to take the... (3 Replies)
Discussion started by: sdosanjh
3 Replies

5. Shell Programming and Scripting

Help in assigning values to variables from the file

Hi! This might be a simple thing, but I'm struggling to assign values to variables from the file. I've the following values stored in the file.. It consists of only two rows.. 10 20 I want to assign the first row value to variable "n1" and the second row value to variable "n2".. That is ... (3 Replies)
Discussion started by: abk07
3 Replies

6. Shell Programming and Scripting

Exporting Values of Variables to Another File

Hello, I'm very new to Linux, and I have a question, I'm hoping you could help me with. :) I have created a file called subject, contains this code: #!/bin/bash read -p "Student Name: " NAME read -p "Student ID: " ID read -p "Address: " ADDRESS I'm to create another file called... (7 Replies)
Discussion started by: iwant2learn
7 Replies

7. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

8. Shell Programming and Scripting

Get values block by block in same file

I have a file say "SAMPLE.txt" with following content, P1 10,9:6/123456 P2 blah blah P1 10,9:5/98765 P2 blah blah P1 blah blah P2 I want a output file say "RESULT.txt" as, Value1:123456 Value2:98765 Value3:NULL (17 Replies)
Discussion started by: garvit184
17 Replies

9. Shell Programming and Scripting

A better way to assign values to variables - shell

so i've been used to doing it this way: SVAL=$(echo "7 3 2 38 3" | awk '{print $2}') 4VAL=$(echo "4:21:N:3" | awk -F":" '{print $4}') I know there's a way to do it by putting the value in an array and assigning it that way. but i'm not sure how to do it efficiently. any ideas? i dont... (9 Replies)
Discussion started by: SkySmart
9 Replies

10. Shell Programming and Scripting

Extract multiple values into corresponding variables

Here is my input # MANIFEST.MF Manifest-Version: 1.0 Build-Jdk: 1.6.0 Built-By: CM_TEAM Build_SvnRev: 662789 Build_Number: 13.0.0.0-JDK8 Build_Date: Wed 04/05/2017-20:48:19.17 Archiver-Version: Plexus Archiver Created-By: Apache Maven 3.1.0 Here is the expected output:... (4 Replies)
Discussion started by: kchinnam
4 Replies
SVK::Command::Info(3)					User Contributed Perl Documentation				     SVK::Command::Info(3)

NAME
SVK::Command::Info - Display information about a file or directory SYNOPSIS
info [PATH | DEPOTPATH]... OPTIONS
-R [--recursive] : descend recursively DESCRIPTION
For example, here's the way to display the info of a checkout path: % svk info ~/dev/svk Checkout Path: /Users/gugod/dev/svk Depot Path: //svk/local Revision: 447 Last Changed Rev.: 447 Last Changed Date: 2006-11-28 Copied From: /svk/trunk, Rev. 434 Merged From: /svk/trunk, Rev. 445 You can see the result has some basic information: the actual depot path, and current revision. Next are advanced information about copy and merge source for this depot path. The result of "svk info //svk/local" is almost the same as above, except for the "Checkout Path:" line is not there, because you are not referring to a checkout path. Note that the revision numbers on "Copied From:" and "Merged From:" lines are for the source path (//svk/trunk), not the target path (//svk/local). The example above state that, //svk/local is copied from the revision 434 of //svk/trunk, and //svk/local was merged from the revision 445 of //svk/trunk. Hence if you do a "svk log -r 434 //svk/local", svk would tell you that //svk/local does not exist at revision 434. So far there is no easy way to tell the actual revision number of //svk/local right after a copy or merge. If the target is a depot path, or the corresponding depot path of the target checkout path is actually a mirroring path, the output of this command will look like this: % svk info //svk/trunk Depot Path: //svk/trunk Revision: 447 Last Changed Rev.: 445 Mirrored From: svn://svn.clkao.org/svk, Rev. 1744 So you can see this depot path is mirrored from a remote repository, and so far mirrored up to revision 1744. perl v5.10.0 2008-08-04 SVK::Command::Info(3)
All times are GMT -4. The time now is 03:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy