10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have written a (bash) function which generates multiple files say file1 file2 file3
now I want to reduce the generation of these three files i.e. store the output of three files in variables, and generate the same results, in-order to avoid multiple creation of files
how is that... (7 Replies)
Discussion started by: sam@sam
7 Replies
2. Shell Programming and Scripting
Hi,
I search for a string "can be any" and print the fields $4,$6 in to variables.
$ cat input
<value ='can be any' string='many' version='123'/>
<value ='xyz' string='less' version='456'/>
$ cat tried_code
SRG=`awk -F\' '{ print $4 }' input`
VER=`awk -F\' '{ print $6 }' input`
... (4 Replies)
Discussion started by: greet_sed
4 Replies
3. Shell Programming and Scripting
Hi,
How to set as variable from sql output.
Query:
select aa.serial, ao.name from ann_amit aa JOIN ann_object ao on (aa.classid=ao.classid);
I got two values from aa.serial and ao.name, I wanna make two different variable for aa.serial and ao.name.
The value of aa.serial should be in... (2 Replies)
Discussion started by: KarthikPS
2 Replies
4. Shell Programming and Scripting
Hi
I need to assign the ouput of a awk statement to two variables; below is a example of the txt file i have which I use awk against
sample file
testval,USA,loc2,testing02
testval1,GB,loc4,testing01
awk statement
awk -F , '{print $2,$3}'
USA loc2
GB loc4
I need a method where... (6 Replies)
Discussion started by: duckeggs01
6 Replies
5. Shell Programming and Scripting
Hi , I have below command to that outputs from variables..
command:
echo $INSTANCE $DATAB $status $TSLastBackup| awk '{printf("%-8s %-8s \t \n",$1,$2,$3,$4)}' | tee $LOGF
the ouput is now:
INSTANCE DATABSE BACKUP_STATUS BACKUPTIMESTAMP
------- -------- -------- ... (1 Reply)
Discussion started by: db2_usd
1 Replies
6. Shell Programming and Scripting
Im trying to read the awk output to two variables. In the below code i need to store the if part output to a variable (NEW) and else part output to another variable (BAD). Pls shed some light on this snippet or if there is any other way to achieve it wud be appreciated (only condition is it needs... (7 Replies)
Discussion started by: michaelrozar17
7 Replies
7. Shell Programming and Scripting
Trying to finish up my script that automates some video encoding work.
Situation: There is an MKV file to be transcoded.
Problem: MKVINFO will give a bunch of output about an MKV file, included in that output are two lines I am interested in:
| + Default duration: 41.708ms (23.976 fps... (9 Replies)
Discussion started by: randyharris
9 Replies
8. Shell Programming and Scripting
Hi all,
Currently, i have a log file seperated by 'tab' and each record starting with a new line. i managed to retrieve the column that i'm interested in. (source_ip_address: xxx.xxx.xxx.xxx).
example of awk output: '{ print $43 }' assuming the field is at column 43.
10.10.10.10... (4 Replies)
Discussion started by: faelric
4 Replies
9. UNIX for Dummies Questions & Answers
What am I doing wrong? I was searching for the answer to assigning variables from output. I found this simple response
ls -l apply_want.m | read perms links owner group size mtime1 mtime2 mtime3 file
this should allow me to echo the variables
echo "$perms | $links | $owner | $group |... (2 Replies)
Discussion started by: whamchaxed
2 Replies
10. Shell Programming and Scripting
I do a lot of command line scripting to capture data from files or other command output. I've checked in a number of Unix and scripting books but for the life of me I can't find out how to asign field data from nawk output into variables that I can manipulate later. For example, reading a two... (6 Replies)
Discussion started by: steveje0711
6 Replies