10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to know if there is a way to use the while read command from a awk record. The record has 3 or 4 lines and I need the line to be all of the record instead of just each line of it.
nawk 'BEGIN {RS="!"} /atm pvc/ {print $0}' router.list | while read line
do
VP=`echo "$line" | egrep "atm... (7 Replies)
Discussion started by: numele
7 Replies
2. Answers to Frequently Asked Questions
If you see this:
awk: syntax error near line 1
awk: bailing out near line 1
Chances are you are working on Solaris and you are using standard awk.
If so, you need to use /usr/xpg4/bin/awk instead, which is POSIX awk (or nawk if that is not available). (1 Reply)
Discussion started by: Scrutinizer
1 Replies
3. Shell Programming and Scripting
Hi All,
Content of mydatafile-
Name Age
-------------- ---------------
Raju P 20 years
Hari 25 years
Priya S 30 years
I need output like-
The age of Raju P is 20 years
The age of Hari is 25 years
The age of Priya S is... (3 Replies)
Discussion started by: NARESH1302
3 Replies
4. Shell Programming and Scripting
Hi I am trying to execute the following awk script in unix but getting
the following error
awk: syntax error near line 1
awk: bailing out near line 1
for i in `cat search`
do
grep -i -l $i *.sas | awk -v token=$i '{print token "\t" $0}'
done
Please let me know what could be the... (4 Replies)
Discussion started by: nandugo1
4 Replies
5. Shell Programming and Scripting
Hello,
I trying to extract text that is surrounded by xml-tags. I tried this
cat tst.xml | egrep "<SERVER>.*</SERVER>" |sed -e "s/<SERVER>\(.*\)<\/SERVER>/\1/"|tr "|" " "
which works perfect, if the start-tag and the end-tag are in the same line, e.g.:
<tag1>Hello Linux-Users</tag1>
... (5 Replies)
Discussion started by: Sebi0815
5 Replies
6. UNIX for Dummies Questions & Answers
I am wondering if anyone has any idea how to use an awk within awk to read files and find a match which adds to count.
Say I am searching how many times the word crap appears in each files within a directory. How would i do that from the command prompt ...
thanks (6 Replies)
Discussion started by: flevongo
6 Replies
7. Shell Programming and Scripting
I am trying to output the total number of records that have name and address within there specific fields i.e. $6 (surname) $9 (address). The file that redirects in is a csv file.
The code is wrong somewhere as i have another awk similar to this that reads in the same file and that works... (2 Replies)
Discussion started by: Pablo_beezo
2 Replies
8. Shell Programming and Scripting
Hi , i am having some problem with re-reading the same file in AWK.
here is the scenario.
function 1 {
some_string > " file1 " # i have redirected output to file1.
...........
........
}
Now in
function 2 {
... (1 Reply)
Discussion started by: madhaviece
1 Replies
9. Shell Programming and Scripting
Hi,
I've got a file like the following:
Starting to process segment 0 (and symmetry related segments)
Number of (cancelled) singularities: 0
Number of (cancelled) negative numerators: 0
Segment 0: 5.49secs
Starting to process segment 1 (and symmetry related segments)
Number of... (7 Replies)
Discussion started by: giorgos193
7 Replies
10. Shell Programming and Scripting
Hi
I'm using cygwin and the script below works just fine under cygwin..
when i upload it on a unix server the script fails with the following errors
-awk: syntax error near line 1
-awk: bailing out near line 1
any ideas why?
thanx
awk '($2 ~ /*/) {
if ($4 < 40){
print... (3 Replies)
Discussion started by: kion
3 Replies