05-14-2004
PASS parameter to AWK
Hi,
Can i pass a parameter(not a file name) as a parameter to a awk program?
eg;
$awk -f test 1 2 3
here test is the filename...and 1,2,3 are the i/p parameters?
thank you:-)
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am having scenario where
input file is containing text like below
-----------------------------------
Name,x.y.z.i.j.k,p.q.r.s.t.k,y.d.f.u.g.h,e.r.t.yu.t.u,......
Place,Bangalore,hyderabad,Chennai,Delhi,............
I need to read and put it in file in a column structure
... (1 Reply)
Discussion started by: prasanta jena
1 Replies
2. Shell Programming and Scripting
I would like to write a scirpt a.sh that it first checks the first parameter of the input. If it fulfill some condition ,then run an executable program b by using all the parameter.
ie.
> ./a.sh 10 20 30 40 50
Then a.sh first checks the first parameter, 10, if it mathes the requirement, then... (2 Replies)
Discussion started by: alfredo
2 Replies
3. Shell Programming and Scripting
Hi all,
How to pass a parameter from a oracle pl/sql procedure parameter to shell environment and use it? (1 Reply)
Discussion started by: megh
1 Replies
4. Shell Programming and Scripting
Hi,
i am new to awk. I am using csv2pipe script(shown below)
BEGIN { FS=SUBSEP; OFS="|" }
{
result = setcsv($0, ",")
print
}
# setcsv(str, sep) - parse CSV (MS specification) input
# str, the string to be parsed. (Most likely $0.)
# sep, the separator between the values.
#
#... (6 Replies)
Discussion started by: bhaskarjha178
6 Replies
5. Shell Programming and Scripting
hi guys
i need your help , i wrote one script which is as below
#!/bin/ksh
###########################################################
LOGDIR=/export/home/xyz/logs
EMAILFile=$LOGDIR/xxs_email.log
BOX=$(uname -a | awk '{print $2}')
awk '{if ($4 >= 30) {print $1 " " $3 " HAS LAG of "... (1 Reply)
Discussion started by: tapia
1 Replies
6. UNIX for Dummies Questions & Answers
Hello
I have a simple code like this one:
#!/bin/ksh
VER=$1
cat /usr/text | while read line
do
echo $line
done
Let's say $1=1.0.0 and the contents of text is:
abcd.cfg
asdf
I would like the output to be like this
abcd1.0.0.cfg
asdf1.0.0
I am thinking of passing the... (5 Replies)
Discussion started by: khestoi
5 Replies
7. Shell Programming and Scripting
Hi Guys,
I have a file in the format Parmater=value. I want to read the value and pass it to corresponding Variable.
The Parameter file is as follows
Number=23
Text1=mango
Text2=yup
'Number' value needs to be read and passed to ID variable. Also, 'Text1' value needs to be passed to... (9 Replies)
Discussion started by: mac4rfree
9 Replies
8. Shell Programming and Scripting
Hi,
I have following for loop , please let me know how to get ${TXP_EXT_TABLE_${i}_SQL} parameter with 1DAY and 7DAY values.
for i in 1DAY 7DAY
do
${NZSQL_DIR}/nzsql -h ${HOST} -time -v ON_ERROR_STOP=1 -f ${SQL_DIR}/${TXP_EXT_TABLE_${i}_SQL} > ${TMP_LOG_FILE} 2>&1
done
... (4 Replies)
Discussion started by: sandy162
4 Replies
9. Post Here to Contact Site Administrators and Moderators
Variable I have in my shell script
diff=$1$2.diff
id=$2
new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new
I could see value of $id is not passing to the awk... (0 Replies)
Discussion started by: Ashunayak
0 Replies
LEARN ABOUT PHP
forward_static_call
FORWARD_STATIC_CALL(3) 1 FORWARD_STATIC_CALL(3)
forward_static_call - Call a static method
SYNOPSIS
mixed forward_static_call (callable $function, [mixed $parameter], [mixed $...])
DESCRIPTION
Calls a user defined function or method given by the $function parameter, with the following arguments. This function must be called
within a method context, it can't be used outside a class. It uses the late static binding.
PARAMETERS
o $function
- The function or method to be called. This parameter may be an array, with the name of the class, and the method, or a string,
with a function name.
o $parameter
- Zero or more parameters to be passed to the function.
RETURN VALUES
Returns the function result, or FALSE on error.
EXAMPLES
Example #1
forward_static_call(3) example
<?php
class A
{
const NAME = 'A';
public static function test() {
$args = func_get_args();
echo static::NAME, " ".join(',', $args)."
";
}
}
class B extends A
{
const NAME = 'B';
public static function test() {
echo self::NAME, "
";
forward_static_call(array('A', 'test'), 'more', 'args');
forward_static_call( 'test', 'other', 'args');
}
}
B::test('foo');
function test() {
$args = func_get_args();
echo "C ".join(',', $args)."
";
}
?>
The above example will output:
B
B more,args
C other,args
SEE ALSO
forward_static_call_array(3), call_user_func_array(3), call_user_func(3), is_callable(3), information about the callback type.
PHP Documentation Group FORWARD_STATIC_CALL(3)