03-16-2006
I have to use AWK only
Quote:
Originally Posted by tmarikle
Now replace awk with nawk.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
when declaring a variable e.g.
export DAYS
what checking / how can i check that the value assigned only contains numeric characters or integers ? (1 Reply)
Discussion started by: jinky
1 Replies
2. Shell Programming and Scripting
I'm trying to run a ksh script with a case condition to handle parameters.
#!/bin/ksh
db_start(){
*code
}
db_shut(){
*code
}
case "$1" in
up)
db_start TRNG
;;
down)
db_shut TRNG
;;
*)
echo "Usage: $0 { up | down }" (3 Replies)
Discussion started by: digiteck
3 Replies
3. Shell Programming and Scripting
Hi
I made a small script which uses ksh.
When i run the script then i get the following error
However when i run each of the commands on the commandline they get executed and provide the desired output. i cant figure out why the script is not running.
Kindly Help
Thanks in... (3 Replies)
Discussion started by: PradeepRed
3 Replies
4. UNIX for Dummies Questions & Answers
i have following in block
if
then
echo "Exclusion criteria"
else
echo "Not exclusion criteria"
fi
now above block runs fine if value of variable line_by_line is "00000000dfahfahfahfahsfhasfhafhahfahfahf" but same block gives error if value is "0000000000202000501000069BAG ICE ... (1 Reply)
Discussion started by: mahabunta
1 Replies
5. Shell Programming and Scripting
Hi All,
I have got a problem. I have written a Shell script which cuts some information from the file a and puts it in file b. But i get this error when i execute the shell script.
This is what i have written in the script.
#! /usr/bin
cd /test
ls $2 > a
cut -f 1 -d '.' a > b
When i... (2 Replies)
Discussion started by: srikanthshastry
2 Replies
6. Shell Programming and Scripting
I am having a problem with this command working, can anyond help?
$ export Path=/user/bin user/local/bin /user/ucb/bin (2 Replies)
Discussion started by: vthokiefan
2 Replies
7. Shell Programming and Scripting
Hi,
I have the following issue while replacing text in a file usind sed
$ cat file
$ One,ABCD\XYZ,Server one
i want to replace ABCD\XYZ with another text SERVER. with ABCD\XYZ stored in a variable.
#!/bin/ksh
VAR=ABCD\XYZ
echo $VAR
cat file | sed 's/'"$VAR"'/SERVER/'
... (14 Replies)
Discussion started by: sudheer1984
14 Replies
8. Shell Programming and Scripting
Hi All,
I have a fixed-width datafile from which i need to extract value/string starting from some position to the specified length in each of the lines.
awk '{print substr($0,x,y)}' datafile --- is working fine
but
awk 'BEGIN{a=0}{a=substr($0,x,y);print $a}' datafile ---is giving... (3 Replies)
Discussion started by: loggedin.ksh
3 Replies
9. Shell Programming and Scripting
Dear All,
I have a script as follows:
1 #! /bin/ksh
2 #
28 varDate=`date +%d%h%y`
29 export spool_file=/app/my_user/work/TH_Status_${varDate}_Check.txt
30
31 #########################
32 # Unix Code Starts here #
33 #########################
... (3 Replies)
Discussion started by: saps19
3 Replies
10. Shell Programming and Scripting
Script A:
#!/bin/ksh
/usr/bin/mail -s "case 4" g@f.com <testF5Email.inp
Script B:
#!/bin/ksh
qq="-s \"case 4\" cstsang@hko.hksarg"
/usr/bin/mail $qq<testEmail.inp
Script A working properly where Script B cannot.
The error message as the following:
There is a missing '"' character... (3 Replies)
Discussion started by: cstsang
3 Replies
DDB(8) BSD System Manager's Manual DDB(8)
NAME
ddb -- configure DDB kernel debugger properties
SYNOPSIS
ddb capture [-M -core] [-N -system] print
ddb capture [-M -core] [-N -system] status
ddb script scriptname
ddb script scriptname=script
ddb scripts
ddb unscript scriptname
ddb pathname
DESCRIPTION
The ddb utility configures certain aspects of the ddb(4) kernel debugger from user space that are not configured at compile-time or easily
via sysctl(8) MIB entries.
To ease configuration, commands can be put in a file which is processed using ddb as shown in the last synopsis line. An absolute pathname
must be used. The file will be read line by line and applied as arguments to the ddb utility. Whitespace at the beginning of lines will be
ignored as will lines where the first non-whitespace character is '#'.
OUTPUT CAPTURE
The ddb utility can be used to extract the contents of the ddb(4) output capture buffer of the current live kernel, or from the crash dump of
a kernel on disk. The following debugger commands are available from the command line:
capture [-M core] [-N system] print
Print the current contents of the ddb(4) output capture buffer.
capture [-M core] [-N system] status
Print the current status of the ddb(4) output capture buffer.
SCRIPTING
The ddb utility can be used to configure aspects of ddb(4) scripting from user space; scripting support is described in more detail in
ddb(4). Each of the debugger commands is available from the command line:
script scriptname
Print the script named scriptname.
script scriptname=script
Define a script named scriptname. As many scripts contain characters interpreted in special ways by the shell, it is advisable to
enclose script in quotes.
scripts
List currently defined scripts.
unscript scriptname
Delete the script named scriptname.
EXIT STATUS
The ddb utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
The following example defines a script that will execute when the kernel debugger is entered as a result of a break signal:
ddb script kdb.enter.break="show pcpu; bt"
The following example will delete the script:
ddb unscript kdb.enter.break
For further examples, see the ddb(4) and textdump(4) manual pages.
SEE ALSO
ddb(4), textdump(4), sysctl(8)
HISTORY
The ddb utility first appeared in FreeBSD 7.1.
AUTHORS
Robert N M Watson
BUGS
Ideally, ddb would not exist, as all pertinent aspects of ddb(4) could be configured directly via sysctl(8).
BSD
December 24, 2008 BSD