10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
im trying to get
awk to print the string between 3rd and 4th backslashs to end of line
test could be any word
this
http://example.com/test/ >to this
http://example.com/test/ > testalso the other way round insert string at end of line... (13 Replies)
Discussion started by: bob123
13 Replies
2. Shell Programming and Scripting
hello.
How to remove all characters in a line from first character ( a $ ) until and including the third occurrence of that character ( $ ).
Any help is welcome. (10 Replies)
Discussion started by: jcdole
10 Replies
3. Shell Programming and Scripting
I'm new to awk, trying to understand the basics.
I'm trying to reset the counter everytime the program gets a new file to check.
I figured in the BEGIN part it would work, but it doesn't.
#!/bin/awk -f
BEGIN {counter=0}
{
sum=0
for ( i=1; i<=NF;... (1 Reply)
Discussion started by: guitarist684
1 Replies
4. Shell Programming and Scripting
I am trying to understand how to use the END block in awk without much success. I have this script that I found:
gawk '{count++; keyword = $1}
if (count == 3) keyword = "order this"
else print keyword " " k
}
}' << orderfile
Is that the way that the END block should be used? I am... (6 Replies)
Discussion started by: newbie2010
6 Replies
5. Fedora
pointsb=`awk -v a2="$a2" -v b2="$b2" -v c2="$c2" -v yb="$yb" -v yc="$yc" \
'BEGIN { for (y=yc; y<=yb; y++) { x = a2*y*y+b2*y+c2; print x, y }; }'`
I am learning shell script. I was reading a script and got confused in this line.
I understood that awk is allowing to assign the variable.
But... (10 Replies)
Discussion started by: agriz
10 Replies
6. Shell Programming and Scripting
Given:
1,2,whatever,a,940,sot
how can i print from one particular field to the end of line?
awk -F"," '{print $2 - endofline}'
the delimiter just happens to be a comma "," in this case. in other cases, it could be hypens:
1---2---whatever---a---940---sot (4 Replies)
Discussion started by: SkySmart
4 Replies
7. Shell Programming and Scripting
Hi
I have written a script .The script runs properly if i write sql queries .But if i use PLSQL commands of BEGIN if end if , end ,then on running the script the comamds are getting printed on the prompt .
Ex :temp.sql
After connecting to the databse at the sql prompt i type... (1 Reply)
Discussion started by: isha_1
1 Replies
8. Shell Programming and Scripting
Hi,
Contents of BBS-list file:
foo
foo
foo
awk '
BEGIN { print "Analysis of \"foo\"" }
/foo/ { ++n }
END { print "\"foo\" appears", n, "times." }' BBS-list
Output:
Analysis of "foo"
"foo" appears 3 times.
awk ' (3 Replies)
Discussion started by: cola
3 Replies
9. UNIX for Advanced & Expert Users
Hi,
I need help with using an awk or sed filter on the below line
ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE
Look for... (1 Reply)
Discussion started by: rajan_san
1 Replies
10. Shell Programming and Scripting
Hi,
I need help with using an awk or sed filter on the below line
ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE
Look for... (2 Replies)
Discussion started by: rajan_san
2 Replies