Sponsored Content
Top Forums Shell Programming and Scripting [SOLVED] Capturing output in a korn variable Post 302641069 by daurin on Tuesday 15th of May 2012 03:00:33 PM
Old 05-15-2012
Yes indeed. Was embarrassed to post all my spaghetti, but here it is:
(PS. was forced to chop up the urls since this is a new account)

PPS. Got it squared from your comments re IFS this afternoon, cut my code back out of the post.
Thanks again!

Last edited by daurin; 05-15-2012 at 08:44 PM.. Reason: Code tags
This User Gave Thanks to daurin For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

capturing the output of grep as integer variable

Hi, I have an expression using grep and nawk that captures the ID number of a given Unix process. It gets printed to screen but I don't know how to declare a variable to this returned value! For example, ps -ef|grep $project | grep -v grep | nawk '{print $2}' This returns my number. How... (2 Replies)
Discussion started by: babariba
2 Replies

2. Shell Programming and Scripting

Losing new lines when capturing output to variable

Explain this? $ ls | grep -e "crd\|cs" crd cs $ CLONES=`ls | grep -e "crd\|cs"`;echo $CLONES; crd cs $ CLONES=`ls | grep -e "crd\|cs"`;echo "$CLONES"; crd cs (1 Reply)
Discussion started by: blasto333
1 Replies

3. Shell Programming and Scripting

capturing output from top and format output

Hi all, I'd like to capture the output from the 'top' command to monitor my CPU and Mem utilisation.Currently my command isecho date `top -b -n1 | grep -e Cpu -e Mem` I get the output in 3 separate lines.Tue Feb 24 15:00:03 Cpu(s): 3.4% us, 8.5% sy .. .. Mem: 1011480k total, 226928k used, ....... (4 Replies)
Discussion started by: new2ss
4 Replies

4. Shell Programming and Scripting

Capturing output of procedure in variable in shell script

Hi guys I am calling one DB2 stored proc through unix. It is giving me below output. I want to capture the value 150 in one UNIX variable in shell script. Please let me know how I can achieve this. Thanks in advance Value of output parameters -------------------------- Parameter Name :... (5 Replies)
Discussion started by: vnimavat
5 Replies

5. Shell Programming and Scripting

[Solved] Output in bash script not captured in variable

I'm tring to write down a simple script that would execute a command and wait until it returns a specific result. This is what i did: bjobs_out=`bjobs` while ]; do bjobs_out=`bjobs` sleep 6 done It seems to work until the command 'jobs' return the list of jobs in execution, but... (4 Replies)
Discussion started by: lifedj
4 Replies

6. UNIX for Dummies Questions & Answers

Solved: how to save an output to a variable

i want to save the output of /scripts/whoowns domain.com to a username like $user = /scripts/whoowns domain.com but I'm not sure how to do that This is inside a bash script how can I get the output of /scripts/whoowns then save that to a variable? thanks! ---------- Post updated at... (0 Replies)
Discussion started by: vanessafan99
0 Replies

7. UNIX for Dummies Questions & Answers

[solved]Korn, disabling * substitution

If I execute the following line of code: echo "*" I get a list of files in the current directory. What if all I wanted to do was display the asterisk itself? What does the code have to look like so all I get is an asterisk? Thanks ahead of time for your assistance ----------... (3 Replies)
Discussion started by: Wreckoning
3 Replies

8. Shell Programming and Scripting

Capturing Output?

Hello All, I'm writing a Bash Script and in it I execute a piped command within a Function I wrote and I can't seem to redirect the stderr from the 1st pipe to stdout..? I'm setting the output to an Array "COMMAND_OUTPUT" and splitting on newlines using this --> "( $(...) )". By putting... (6 Replies)
Discussion started by: mrm5102
6 Replies

9. Shell Programming and Scripting

[Solved] Issue with using for loop as for in {2..6} in korn shell

Hi i have to cut columns 2 to 6 from a file and assign it to arrays , The following code works for ctcol in 2 3 4 5 6; do set -A a$ctcol $(cut -d, -f $ctcol test_file) done how ever this does not work for ctcol in {2..6}; do set -A a$ctcol $(cut -d, -f $ctcol test_file)... (4 Replies)
Discussion started by: 100bees
4 Replies

10. UNIX for Dummies Questions & Answers

[Solved] Korn Shell execution

There are two Korn Shell scripts : script_1.ksh ( located in /home/dir1 ) script_2.ksh ( located in /home/dir2 ) Content of script_2.ksh is #!/usr/bin/ksh echo "Hello world.." The script_2.ksh is called from within script_1.ksh using the following command : ./home/dir2/script_2.ksh but... (7 Replies)
Discussion started by: kumarjt
7 Replies
WNPP-CHECK(1)						      General Commands Manual						     WNPP-CHECK(1)

NAME
wnpp-check - check if a package is being packaged or if this has been requested SYNOPSIS
wnpp-check package ... wnpp-check --help|--version DESCRIPTION
wnpp-check downloads the lists of packages which are listed as being packaged (ITPed) or for which a package has been requested (RFPed) from the WNPP website and lists any packages supplied on the command line which appear in those lists. Note that WNPP, and therefore wnpp-check's output, is source package based. OPTIONS
--help, -h Show a summary of options. --version, -v Show version and copyright information. SEE ALSO
http://www.debian.org/devel/wnpp EXIT STATUS
0 None of the packages supplied has an open ITP or RFP 1 Either an error occurred or at least one package supplied has an open ITP or RFP AUTHOR
wnpp-check was written by David Paleino <d.paleino@gmail.com>; this man page was written by Adam D. Barratt <adam@adam-barratt.org.uk> for the devscripts package. wnpp-check was originally based on wnpp-alert, which was written by Arthur Korn <arthur@korn.ch> and modified by Julian Gilbey <jdg@debian.org> for the devscripts package. Both scripts are in the public domain. DEBIAN
Debian Utilities WNPP-CHECK(1)
All times are GMT -4. The time now is 11:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy