10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi to all,
May someone help me with the following.
The awk script below is part of a bigger awk script, and this part attempts to print an Ip address that is in hex format in decimal format. I'm trying with following code but
I'm getting 0.0.0.0 and the correct answer is 192.168.140.100
... (9 Replies)
Discussion started by: Ophiuchus
9 Replies
2. Shell Programming and Scripting
Hello,
I have a set of files Xfile0001 - Xfile0021, and the content of this files (one at a time) needs to be printed between some line (lines start with word "Generated") that I am extracting from another file called file7.txt and all the output goes into output.txt. First I tried creating a for... (5 Replies)
Discussion started by: jaldo0805
5 Replies
3. UNIX for Advanced & Expert Users
All of my machines (various open source derivatives on x86 and amd64) store argv above the stack (at a higher memory address). I am curious to learn if any systems store argv below the stack (at a lower memory address).
I am particularly interested in proprietary Unices, such as Solaris, HP-UX,... (9 Replies)
Discussion started by: alister
9 Replies
4. Shell Programming and Scripting
Hi guys,
i'm trying to solve this problem.
I have to run something like
cat file1.txt | awk -f script.awk 10
if i'm in the awk script, how can i take the parameter :10 ??:wall:
i try something like :
BEGIN{
var=argv
}
{..}
END{..}
but obviously is not correct... (5 Replies)
Discussion started by: heaven25
5 Replies
5. Shell Programming and Scripting
I have written this code in an awk script.
BEGIN {
print "ARGV", ARGV
if ( match(ARGV,/-u/) || match(ARGV,/--usg/) ) {
print "MATCH -u:",match(ARGV,/-u/), RSTART, RLENGTH
print "MATCH --usg:",match(ARGV,/--usg/), RSTART, RLENGTH
usage()
exit(1)
}
}
I want... (7 Replies)
Discussion started by: kristinu
7 Replies
6. Shell Programming and Scripting
Hi,
I am using awk statement to extract data from a file and write a new file with certain columns rearranged and few hard coded values added to new file.
Now i need to add a column with sysdate. can i do that inside the awk print statement?
Now:
nawk ' /^3/ BEGIN {FS=","}... (2 Replies)
Discussion started by: selvankj
2 Replies
7. Shell Programming and Scripting
Hi Friends,
I have small issue with following code snippet.
I am trying call one function inside awk in which the function inturn will echo few lines. However when i ran script its throwing an error saying "nawk: syntax error at source line 1".
#!/bin/sh
eval input=$@
while read... (3 Replies)
Discussion started by: Shahul
3 Replies
8. Shell Programming and Scripting
Im want to print filename inside loop .. the code im using :-
Filename_1=abc_20090623_2.csv.lk
Filename_2=def_20090623_2.csv.lk
i want to extract filename till .csv eg
Filename_1=abc_20090623_2
Filename_2=def_20090623_2
How can i do this inside the for loop
... (3 Replies)
Discussion started by: r_t_1601
3 Replies
9. Shell Programming and Scripting
i'm trying to do this (in bash darwin);
echo "give me some words: "
read a
c=2 # this is get by other ways
echo $a | awk '{print $c}' # i want to print the column given
# by de $c variable
if there is someone understand what i pretend... (3 Replies)
Discussion started by: Tártaro
3 Replies
10. UNIX for Dummies Questions & Answers
hello
does anyone knows how can i reach a parameter in awk command line
for example
p1 f 4
p1 is an awk script. 4 is parameter
i want to work with the second parameter
i know it has something to do with argv command
i just dont know the syntax.
please help. (1 Reply)
Discussion started by: emil2006
1 Replies