Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Storing lines of output into a script variable Post 302336848 by ewoods on Thursday 23rd of July 2009 02:12:42 AM
Old 07-23-2009
Works like a charm! Thanks for your help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

storing output of awk in variable

HI I am trying to store the output of this awk command awk -F, {(if NR==2) print $1} test.sr in a variable when I am trying v= awk -F, {(if NR==2) print $1} test.sr $v = awk -F, {(if NR==2) print $1} test.sr but its not working out . Any suggestions Thanks Arif (3 Replies)
Discussion started by: mab_arif16
3 Replies

2. UNIX for Dummies Questions & Answers

Storing the output into a variable

Hi unix gurus, I am trying to store the result of a command into a variable. But it is not getting stored. x='hello' y=echo $x | wc -c but it is giving the output as 0(zero) Pls help me its very urgent (7 Replies)
Discussion started by: ravi raj kumar
7 Replies

3. Shell Programming and Scripting

Using 'defaults read' and storing the output in a variable

Hi all, I'm creating a script which uses 'defaults read' to retrieve details from an Info.plist like this; defaults read "/Path/Contents/Info" CFBundleShortVersionString This works fine in Terminal and returns the expected values. Is it possible to use this command in a script, and... (0 Replies)
Discussion started by: davewg
0 Replies

4. UNIX Desktop Questions & Answers

problem while storing the output of awk to variable

Hi, i have some files in one directory(say some sample dir) whose names will be like the following. some_file1.txt some_file2.txt. i need to get the last modified file size based on file name pattern like some_ here i am able to get the value of the last modified file size using the... (5 Replies)
Discussion started by: eswarreddya
5 Replies

5. Shell Programming and Scripting

storing output from echo & cut into variable

Hi All, Hope someone can advise here as I have been struggling to find a syntax that works here. I have tried a stack of combination I have seed in the forums but I think because I have needed to use "" and `` in the statments another method is found. I am reading in lines with the following... (1 Reply)
Discussion started by: nkwilliams
1 Replies

6. Shell Programming and Scripting

Storing output into a variable

My script below seems to be choking because I need the the output of the find command to be stored as a variable that can then be called by used lower in the script. #!/bin/bash cd "/resumes_to_be_completed" var1=find . -mmin -1 -type f \( -name "*.doc" -o -name "*.docx" \)... (1 Reply)
Discussion started by: binary-ninja
1 Replies

7. Shell Programming and Scripting

sed not storing output in shell script

Hello, Following my learning of shell scripting.. I got stuck yet again. If I execute this command on terminal: $ sed "s/off/on/g" file > fileAUX I successfully change the text off to on from file to fileAUX. But the same command is not working inside a shell script. I tested and... (2 Replies)
Discussion started by: quinestor
2 Replies

8. Shell Programming and Scripting

Storing lines of a file in a variable

i want to store the output of 'tail -5000 file' to a variable. If i want to access the contents of that variable, it becomes kinda difficult because when the data is stored in the variable, everything is mushed together. you dont know where a line begins or ends. so my question is, how can i... (3 Replies)
Discussion started by: SkySmart
3 Replies

9. Shell Programming and Scripting

Storing command output in a variable and using cut/awk

Hi, My aim is to get the md5 hash of a file and store it in a variable. var1="md5sum file1" $var1 The above outputs fine but also contains the filename, so somthing like this 243ASsf25 file1 i just need to get the first part and put it into a variable. var1="md5sum file1"... (5 Replies)
Discussion started by: JustALol
5 Replies

10. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
AMSTATUS(8)						  System Administration Commands					       AMSTATUS(8)

NAME
amstatus - display the state of an Amanda run SYNOPSIS
amstatus [--file amdumpfile] [--summary] [--dumping] [--waitdumping] [--waittaper] [--dumpingtape] [--writingtape] [--finished] [--failed] [--estimate] [--gestimate] [--stats] [--locale-independent-date-format] [--config] config DESCRIPTION
Amstatus gives the current state of the Amanda run specified by the config configuration. If there is no active Amanda running, it summarizes the result of the last run. It may also be used to summarize the results of a previous run. See the amanda(8) man page for more details about Amanda. OPTIONS
All options may be abbreviated to the shortest non-ambiguous sub-string. If no options are given, everything is displayed. [--config] config Specify the Amanda configuration you want to display the state for. --file amdumpfile Specify an alternate file instead of the amdump or amflush file. --summary Display a summary of the state of the run. --dumping Display all partitions that are dumping. --waitdumping|wdumping Display all partitions that are waiting to be dumped. --waittaper|wtaper Display all partitions dumped that are waiting to be written to tape. --dumpingtape|dtape Display all partitions that are dumping directly to tape. --writingtape|wtape Display all partitions that are writing to tape. --finished Display all partitions that are dumped and written to tape. --failed|error Display all partitions that failed. --estimate Display all partitions whose estimate is finished. Works only during the estimate phase. --gestimate|gettingestimate Display all partitions whose estimate is not finished. Works only during the estimate phase. --stats|statistics Display statistics about active-time of taper and dumpers. --locale-independent-date-format Output the date in a locale independent format. The format is the same executing: date +'%Y-%m-%d %H:%M:%S %Z' EXIT CODE
The exit code of amstatus is the ORed value of: 0 = success 1 = error 4 = a dle failed 8 = Don't know the status of a dle (RESULT_MISSING in the report) 16 = tape error or no more tape SEE ALSO
amanda(8), amcheck(8), amdump(8), amrestore(8), amadmin(8) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHOR
Stefan G. Weichinger <sgw@amanda.org> Amanda 3.3.1 02/21/2012 AMSTATUS(8)
All times are GMT -4. The time now is 08:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy