I have an awk file where I need to pass a filename and a value as a parameter from a sh script. I need to know how to pass those values in the sh script and how to use the same in the awk file.
Thanks in advance!!!
Geetha (3 Replies)
I am trying to pass max as a sommand line argument when I call awk.
Made the modification in the BEGIN but it is not working
I'm getting an error as below:
awk: txsrx.awk:82: (FILENAME=jcd.tx FNR=4161) fatal: cannot open file `40' for reading (No such file or directory)
Somehow it... (2 Replies)
Hi, for example I have this function:
function get_param ()
{
test=echo "some string"
test2=echo "someother string"
}
I want to call this function and get test or test2 result, how do I do that ?
Thank you (2 Replies)
Hello,
I have this awk script that I want to execute by passing parameters through a shell script.
I'm a little confused. This awk script removes duplicates from an input file.
Ok, so I have a .sh file called rem_dups.sh
#!/usr/bin/sh... (4 Replies)
I have a working and tested AWK script that removes duplicates from an input file and generates an output file without the duplicates.
I had help from my other post to develop it:
... (3 Replies)
Why does this work
for myfile in `find . -name "R*VER" -mtime +1`
do
SHELLVAR=`grep ^err $myfile || echo "No error"`
ECHO $SHELLVAR
done
and outputs
No error
err ->BIST Login Fail 3922 err
No error
err ->IR Remote Key 1 3310 err
But... (2 Replies)
Hi I have a batch file aaa.exe which needs two input parameters:
Usually the command's format likes
aaa 555 10000
But I want to use parameters to do it.
aaa $1 $2
These two parameters come from a text file list.txt
41800497 41801375
41814783 41816135
41814930 41816135
41819987 41820843... (4 Replies)
There's a JavaScript file that I call from command line (there's a framework) like so:
./RunDiag.js param1:'string one here' param2:'string two here'
I have a shell script where I invoke the above command. I can run it in a script as simple as this
#!/bin/bash
stuff="./RunDiag.js... (4 Replies)
Hello,
I'm having some issues getting a home dir from a remote server passed to a variable.
Here is what I have so far:
rsh server "(ls -ld /home*/user | awk '{print \$9}')"
/home3/userThat works fine and brings back what I need.
But when I try to add it to a variable it goes all... (3 Replies)
Hi,
I am trying to pass awk field to a command line executed within awk (need to convert a timestamp into formatted date).
All my attempts failed this far.
Here's an example.
It works fine with timestamp hard-codded into the command
echo "1381653229 something" |awk 'BEGIN{cmd="date -d... (4 Replies)
Discussion started by: tuxer
4 Replies
LEARN ABOUT SUSE
sg_luns
SG_LUNS(8) SG3_UTILS SG_LUNS(8)NAME
sg_luns - send the SCSI REPORT LUNS command
SYNOPSIS
sg_luns [--decode] [--help] [--hex] [--maxlen=LEN] [--quiet] [--raw] [--select=SR] [--verbose] [--version] DEVICE
DESCRIPTION
Send the SCSI REPORT LUNS command to the DEVICE and outputs the response. In the SPC-3 SCSI standard support for this command is mandatory.
OPTIONS
Arguments to long options are mandatory for short options as well.
-d, --decode
decode logical unit numbers into their hierarchical parts. Interprets luns as described in SAM-3 when the HiSup bit is set in a
standard INQUIRY's response.
-h, --help
output the usage message then exit.
-H, --hex
output response to this command in ASCII hex.
-m, --maxlen=LEN
where LEN is the (maximum) response length in bytes. It is placed in the cdb's "allocation length" field. If not given (or LEN is
zero) then 65536 is used. The maximum value of LEN is 65536.
-q, --quiet
output ASCII hex rendering of each report lun, one per line.
-r, --raw
output response in binary (to stdout).
-s, --select=SR
this option sets the 'select report' field (SR) in the SCSI REPORT LUNS command. The default value is 0. When 0 is given (or this
option is not specified) then the DEVICE should yield a list of luns addressable via this "I_T nexus" that use the following lun
addressing methods: logical unit addressing, peripheral device addressing and flat space addressing. When 1 is given the DEVICE
should yield a list of only "well known" logical units addressable via this "I_T" nexus. When 2 is given the DEVICE should yield all
luns addressable via this "I_T" nexus. To simplify, for the I_T nexus associated with the DEVICE, the meanings of the SR values
are:
0 : all luns excluding well known logical units
1 : well known logical units
2 : all luns
Values greater than 2 are reserved (at SPC-4 (rev 8)).
-v, --verbose
increase the level of verbosity, (i.e. debug output).
-V, --version
print the version string and then exit.
EXIT STATUS
The exit status of sg_luns is 0 when it is successful. Otherwise see the sg3_utils(8) man page.
AUTHORS
Written by Douglas Gilbert.
REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>.
COPYRIGHT
Copyright (C) 2004-2008 Douglas Gilbert
This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR-
POSE.
SEE ALSO sg_inq(8)sg3_utils-1.26 April 2008 SG_LUNS(8)