12-02-2008
Can you try working of this below command.
awk -F^ '{ if ((($1 != "M") && ($5 != "2")) || (($1 != "S") && ($5 != "7"))) print $0}' welcome > welcome1
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a server.xml file which looks something like.
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100"... (2 Replies)
Discussion started by: nua7
2 Replies
2. Shell Programming and Scripting
Hi All,
i'm trying awk commnad to read only file names with the help of below command :-
ls -l tmp*.txt | awk { 'print $9' } | head -1
The command is working fine :o on command line, but when i trying it in script then its not working
$var1=`ls -l tmp*.txt | awk { 'print $9' } | head -1`... (3 Replies)
Discussion started by: doitnow
3 Replies
3. Shell Programming and Scripting
Hi can someone please help me on this.
I need to perform this code:
Grep any lines that meets the following criteria
(A AND B) OR (A AND C)
I tried this code, but it didn't work
Grep-I "A &&B" | "A&&C" *.* $
thanks in advance (12 Replies)
Discussion started by: Needhelp2
12 Replies
4. UNIX for Advanced & Expert Users
Hi,
Putting across a few awk expressions.
Apart from the last, all of them are working.
echo a/b/c | awk -F'/b/c$' '{print $1}'
a
echo a/b/c++ | awk -F'/b/c++' '{print $1}'
a
echo a/b/c++ | awk -F'/b/c++$' '{print $1}'
a/b/c++
Request thoughts on why putting a '$' post double ++... (12 Replies)
Discussion started by: vibhor_agarwali
12 Replies
5. Shell Programming and Scripting
I'm would to create a script that would give me the results below.
Please note the spaces in the log file are actually commas(",".)
Log file Data
0:00 21:15 899 43 31 12 25.39
0:00 21:20 736 34 19 15 35.39
0:00 21:20 776 41 28 13 ... (3 Replies)
Discussion started by: ravzter
3 Replies
6. Shell Programming and Scripting
Hello guys,
I have little to no experience working with two files in awk and hope you can help me with a problem that may be easy for you to solve...
awk -v cut1="$var1" -v cut2="$var2" '{split($0, arr1); for(i=1;i<=NF;i++) if (arr1 < cut1) print arr1, NR, i}' file1 file2
The above code is... (4 Replies)
Discussion started by: origamisven
4 Replies
7. Shell Programming and Scripting
Can you please help me on belw awk comparsion which doest not work
cat employee_list
NAME Last-login
Jack 03/25/2013
Maneul 03/26/2013
Eric 03/26/2013
Samuel 03/28/2013
loak 03/29/2013
zac 03/29/2013
this is my awk .. it gives me error
cat employee_list | awk '(($2=='date... (3 Replies)
Discussion started by: Sara_84
3 Replies
8. Shell Programming and Scripting
Hi All,
This code is not working when trying with "else" : Am I missing something,
uptime|sed 's/,/ /g' | awk '{ if ($10 >1) { print ( " :: UPTIME GT 1 : ALERT" )} ;else print "OK" }'
Getting this error:
syntax error The source line is 1.
The error context is
{ if... (4 Replies)
Discussion started by: rveri
4 Replies
9. Shell Programming and Scripting
Hi Experts,
Can you please advise , why I am not able to make it work, or why this is not working: I spent quite a lot of time on this figuring out , but not working,
file :
This is a test file thanks for your reply
This is another file again
Have a nice day this is a small file... (3 Replies)
Discussion started by: rveri
3 Replies
10. Shell Programming and Scripting
Hi,
I have around 10 files in a folder in which I want to change the file format from tab(\t) to pipe(|) with some changes in the fields as well. Below is the code, while tmp file is getting generated but move command is not working, please help
Following is the code
awk -F"\t" '{print... (2 Replies)
Discussion started by: siramitsharma
2 Replies