Sponsored Content
Top Forums Shell Programming and Scripting Storing awk command in a variable Post 302916717 by treesloth on Thursday 11th of September 2014 01:08:47 PM
Old 09-11-2014
Thanks for all the replies. I'm trying out the various options, and I didn't want to seem ungrateful while I do so. So, in the interest of supporting future generations of awkers, I will post whatever I find. Again, I appreciate all the replies and 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. Shell Programming and Scripting

storing result of a command in variable

For whatever reason I cant seem to fix my syntax to do the following. I want to run a grep and count how many instances come up and store that number in a variable but I keep erroring out. Here's my code in bash: number=grep blah file.txt | wc -l (1 Reply)
Discussion started by: eltinator
1 Replies

3. Shell Programming and Scripting

storing a command in a variable

how would i go about storing this command in a variable echo "$LINE" | awk -F"|" '{print $1"|"$2"|"$3"}' i have tried FOO = ${command up there} but receive the error FOO: not found aswell as a couple of other attempt but no luck (2 Replies)
Discussion started by: nookie
2 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. Programming

Need help in storing command line argument argv[2] to a variable of int type

The following program takes two command line arguments. I want the second argument (fileCount) to be stored/printed as a int value. I tried my best to typecast the char to int (check the printf statement at last) but is not working...the output is some junk value. This program is in its... (3 Replies)
Discussion started by: frozensmilz
3 Replies

6. Shell Programming and Scripting

Storing o/p of a command to a variable

Hi, I have a ftp script there I want to store the o/p of the below command: sftp -b <batch file> user@password cat <batch file> get /remote/file/path/remote_file_name.csv*.gz /local/path Now the problem is that when I fire this command. Then it gives o/p as: File... (7 Replies)
Discussion started by: dips_ag
7 Replies

7. Shell Programming and Scripting

Storing output of "time" command to a variable

Hi all, I am new to Linux/shell scripting having moderate knowledge. In my script, I need to get execution time of a command (say 'ls') in mili seconds level. For this i tried using "time" command to retrieve the total execution time in milli seconds. But, the problem is that, how to save... (9 Replies)
Discussion started by: happening_linux
9 Replies

8. 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

9. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies

10. Shell Programming and Scripting

awk to compare each file in two directores by storing in variable

In the below bash I am trying to read each file from a specific directory into a variable REF or VAL. Then use those variables in an awk to compare each matching file from REF and VAL. The filenames in the REF are different then in the VAL, but have a common id up until the _ I know the awk portion... (15 Replies)
Discussion started by: cmccabe
15 Replies
asmping(1)						      General Commands Manual							asmping(1)

NAME
asmping - check if you can receive IPv4/IPv6 multicast data from an internet host SYNOPSIS
asmping [ -46v ] [ -I interface ] [ -c count ] [ -s size ] group host ssmpingd DESCRIPTION
asmping and ssmpingd are network level multicast management tools that can be used to check whether one can receive multicast packets via ASM from a host. The host target given to asmping must run the ssmpingd daemon, which listens on UDP port 4321 for IPv4 and IPv6 unicast requests. When it receives one, it responds to the specified multicast group which asmping just have joined. Note that one can not use arbitrary groups. Independent of what group is specified, the last quarter of the address is forced to be 234 or ::4321:1234 for IPv4 or IPv6 respectively. OPTIONS
For ssmpingd there are no options. For asmping the options are as follows. -4 Force IPv4 -6 Force IPv6 -v Print client and server version information. -I interface Interface to join on -c count Stop after sending (and receiving) count requests (and replies) -s size Request replies to have a size of size bytes SEE ALSO
ssmping(1) a tool for checking whether can receive SSM. dbeacon(1) a distributed beacon multicast implementation. BUGS
Please report them to Stig Venaas <venaas@uninett.no>, the author of this tool. HISTORY
asmping and ssmpingd were developed by Stig Venaas during the early days of the m6bone, the IPv6 multicast backbone. User Manuals asmping(1)
All times are GMT -4. The time now is 02:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy