01-07-2013
It should work! Make sure you do not have any blank space between assignment operator = and wrap the string variable value in double quotes " to avoid any unexpected behavior.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: iamgeethuj
3 Replies
2. Shell Programming and Scripting
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)
Discussion started by: kristinu
2 Replies
3. Shell Programming and Scripting
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)
Discussion started by: ktm
2 Replies
4. Shell Programming and Scripting
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)
Discussion started by: script_op2a
4 Replies
5. Shell Programming and Scripting
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)
Discussion started by: script_op2a
3 Replies
6. Shell Programming and Scripting
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)
Discussion started by: alan
2 Replies
7. Emergency UNIX and Linux Support
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)
Discussion started by: zhshqzyc
4 Replies
8. Shell Programming and Scripting
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)
Discussion started by: AcerAspirant
4 Replies
9. Shell Programming and Scripting
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)
Discussion started by: elcounto
3 Replies
10. Shell Programming and Scripting
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
innconfval
INNCONFVAL(1) InterNetNews Documentation INNCONFVAL(1)
NAME
innconfval - Get configuration parameters from inn.conf
SYNOPSIS
innconfval [-pstv] [-i file] [parameter ...]
innconfval -C [-i file]
DESCRIPTION
innconfval normally prints the values of the parameters specified on the command line. By default, it just prints the parameter values,
but if -p, -s, or -t are given, it instead prints the parameter and value in the form of a variable assignment in Perl, Bourne shell, or
Tcl respectively. If no parameters are specifically requested, innconfval prints out all parameter values (this isn't particularly useful
unless one of -p, -s, or -t were specified).
All parameters are taken from inn.conf except for version, which is always the version string of INN.
If given the -C option, innconfval instead checks inn.conf, reporting any problems found to standard error. innconfval will exit with
status 0 if no problems are found and with status 1 otherwise.
OPTIONS
-C Check inn.conf rather than printing out the values of parameters.
-i file
Use file as the source configuration file rather than inn.conf. file must be a valid inn.conf file and will be parsed the same as
inn.conf would be.
-p Print out parameters as Perl assignment statements. The variable name will be the same as the inn.conf parameter, and string values
will be enclosed in single quotes with appropriate escaping. Boolean values will be mapped to the strings "true" or "false". List
values will be mapped to an array of strings. NULL values are not printed out and will therefore be "undef" in Perl.
Here is an example:
$enableoverview = 'true';
@extraoverviewadvertised = ( 'Newsgroups', 'Injection-Info' );
$organization = 'Let's try nasty "quotes"';
$maxforks = 10;
If innconfval is called via the Perl "INN::Config" module, all these variables are properly exported.
-s Print out parameters as Bourne shell assignment statements. The variable name will be the inn.conf parameter name in all capitals, and
all variables will be exported, if not NULL. String values will be enclosed in single quotes with appropriate escaping, and boolean
values will be mapped to "true" or "false". List values will be mapped to a space-separated string representing an array of strings
(as Bourne shell does not recognize arrays, contrary to several other shells, an array cannot be returned for interoperability
reasons).
Here is an example:
ENABLEOVERVIEW=true; export ENABLEOVERVIEW;
EXTRAOVERVIEWADVERTISED='"Newsgroups" "Injection-Info"'; export EXTRAOVERVIEWADVERTISED;
ORGANIZATION='Let'''s try nasty "quotes"'; export ORGANIZATION;
MAXFORKS=10; export MAXFORKS;
-t Print out parameters as Tcl assignment statements. The variable name will be the same as the inn.conf parameter name but with "inn_"
prepended, and string variables will be escaped appropriately. Boolean values will be mapped to the strings "true" or "false". List
values will be mapped to an array of strings. NULL values are not printed out.
Here is an example:
set inn_enableoverview "true"
set inn_extraoverviewadvertised { "Newsgroups" "Injection-Info" }
set inn_organization "Let's try nasty "quotes""
set inn_maxforks 10
-v Print INN's version. This is equivalent to "innconfval version".
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews.
$Id: innconfval.pod 8919 2010-01-22 23:29:28Z iulius $
SEE ALSO
inn.conf(5), INN::Config(3pm).
INN 2.5.2 2010-02-08 INNCONFVAL(1)