10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I want to create a shell script with the following awk command & also get the filenames in output.
awk '/<catetcsecuretty0>/ {p=1} /<catvarlogmessages0>/ {p=0} p' *.xml
As there will be multiple outputs related to many xml files I cannot identify which output belongs to which file
... (5 Replies)
Discussion started by: sharp488
5 Replies
2. Shell Programming and Scripting
I am able to execute awk command from shell prompt. but the same command is not getting executed when written and run in a bash script
the command from bash cmd prompt.
awk '/world/{for (i=2; i<NF; i++) printf $i " "; print $NF}1' myfile >tmp$$ ; mv tmp$$ myfile
file:
# hello world my... (4 Replies)
Discussion started by: ashima jain
4 Replies
3. UNIX for Dummies Questions & Answers
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff |... (1 Reply)
Discussion started by: Sarita Behera
1 Replies
4. Shell Programming and Scripting
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
5. Post Here to Contact Site Administrators and Moderators
Variable I have in my shell script
diff=$1$2.diff
id=$2
new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new
I could see value of $id is not passing to the awk... (0 Replies)
Discussion started by: Ashunayak
0 Replies
6. Shell Programming and Scripting
I want to count lines of a file using AWK (only) and not in the END part like this awk 'END{print FNR}' because I want to use it.
Does anyone know of a way?
Thanks a lot. (7 Replies)
Discussion started by: guitarist684
7 Replies
7. Shell Programming and Scripting
..... (3 Replies)
Discussion started by: elbee11
3 Replies
8. Shell Programming and Scripting
Hello,
I have been trying to use an awk script to parse out correct and incorrect answers in a simple tab-delimited text file. I am trying to compare the user's response to the stimulus presented (in this case, an arrow pointing left or right; e.g., "<--" vs. "-->"). I have the data for the... (6 Replies)
Discussion started by: Jahn
6 Replies
9. Shell Programming and Scripting
Hi,
When i run the below command i am able to get the output.
awk '/BEGIN DSSUBRECORD/{c=3;next}c-->0' abc.txt |
awk '/END DSSUBRECORD/{exit}{print}' |
awk '/Owner/{exit}{print}' |
awk '{n2=n1;n1=n;n=$0;if(NR%3==0){printf"%s,%s,%s\n",n2,n1,n}}'
Output:
Name "file_name", ... (5 Replies)
Discussion started by: onesuri
5 Replies
10. Shell Programming and Scripting
hi
i am writing a korn shell script to compile all programs there are arount 2000+ files now i have a script that can compile programs but i want to show status of compilation because to compile all programs it takes around 10-15 mins so how can i display status like it should print no of files... (3 Replies)
Discussion started by: zedex
3 Replies