10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am having script which contains many functions. Need to print each function name at the starting of the function. Like below,
functionname()
{
echo "functionname"
commands....
}
I've tried like below,
func=`grep "()" scriptname | cut -d "(" -f1`
for i in $func
do
nawk -v... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
2. Shell Programming and Scripting
The below bash function uses multiple variables CODING, SAMPLE, SURVEY, andvariant
in it. The user selects the cap function and details are displayed on the screen using the $SURVEY variable, the directory is changed to $SAMPLE and the samples.txt is opened so the user can select the sample to... (6 Replies)
Discussion started by: cmccabe
6 Replies
3. Shell Programming and Scripting
Needing a hint. Creating that function called Meter my simple script works well. What I want now is to start the last four commented lines to include or trigger a reaction, if there are more than n lines in that .txt-file it shall display that message for example. But the interpreter says there is... (3 Replies)
Discussion started by: 1in10
3 Replies
4. Shell Programming and Scripting
Hi All,
I am getting a syntax error message while trying to compare 2 files using the compare function (LINUX)
command substitution: line 79: syntax error near unexpected token `('
command substitution: line 79: `cmp -s <(tr , \n < $COMMON_TMP/nt_per_gs.done | sort) <(tr , \n <... (5 Replies)
Discussion started by: dsfreddie
5 Replies
5. UNIX for Dummies Questions & Answers
Hi !
I got a script from Arabic to Roman numeral conversion - .comp.lang.awk, that I would like to modify to apply it on my input file.
input ("|"-delimited fields):
AAAAAA|1, 10, 13, 14, 25, 60
wanted output:
AAAAAA|I, X, XIII, XIV, XXV, LX
script.awk:
#!/usr/bin/gawk -f
... (11 Replies)
Discussion started by: lucasvs
11 Replies
6. Shell Programming and Scripting
Hi,
I wanted to know what's the difference between the below two syntax used for writing ksh function:
e.g. 1
------
function fn1
{
echo "Hello World"
}
e.g. 2
------
fn1 ()
{
echo "Hello World"
} (4 Replies)
Discussion started by: dips_ag
4 Replies
7. Shell Programming and Scripting
i have a ksh code that needs to be written in AWK. can someone please help me here? :(
if }" | grep -c "$2") -gt 0 ] ; then
print - "found $2 in array ignore"
else
print - "did not find $2 in array ignore"
fi
ignore=4ty56r
ignore=er45ty
.
.
.
ignore=frhtg2 (27 Replies)
Discussion started by: usustarr
27 Replies
8. Shell Programming and Scripting
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies
9. Shell Programming and Scripting
I don't get correct output when I run this command line:
nmap -sP failedhost.com | grep -i failed | awk -F '{print $6}'
I basically want it to return 'failedhost.com' but its just showing the output of the nmap scan. (8 Replies)
Discussion started by: streetfighter2
8 Replies
10. Shell Programming and Scripting
I have written many awk commands which go in multiple lines.
I have this confusion many times.
Some time they work if i dont terminate them with "\" but some time error.
Some time in "if" statements between if and else if i dont use ";" it gives error but sometimes it doesnt.
The below... (4 Replies)
Discussion started by: pinnacle
4 Replies