03-31-2008
grep problem with the ^ symbol, help needed please.
Hello I am new to this forum and have been perplexed by this issue for the last hour of my life, I've tried to search everywhere for a solution to my syntax error, but here is my code.
grep -wvnf 'noise.dat' sample.out | sort
output:
4:Java Swing
5:Swing Java
6:Software Requirements Analysis
7:Requirements Analysis Software
8:Analysis Software Requirements
my desired ouput should be
1 Analysis Software Requirements
2 Filters Pipes and
3 Java Swing
4 Pipes and Filters
5 Requirements Analysis Software
6 Software Requirements Analysis
7 Swing Java
with the line "and Filters Pipes" omitted.
I have tried doing grep -wvnf '^noise.dat' sample.out | sort
with the ^ symbol in there but i get the "grep: ^noise.dat: No such file or directory" with so many different variations, but I just cannot figure it out.
Any help would be greatly appreciated, I have spent so much time on this, and yes I do know I am noob, but my professor for this class is horrible.
10 More Discussions You Might Find Interesting
1. Programming
I use a standard C source to access large files in a 32 bit environment.
I've replaced fopen, fwrite and fread by fopen64, fwrite64 and fread64.
First I did a test only replacing fopen by fopen64, it compiled without any other changes to my compilation options.
The program crashed on a write, as... (3 Replies)
Discussion started by: Isax50
3 Replies
2. UNIX for Dummies Questions & Answers
Hello:
I'm a very newbee at UNIX/AIX.
What i want to do is to tail a file from the bottom until a certain string is found and write all the lines after the found string to another file.
I've tried out a lot of combination with tail and grep but doesn't find the good one.
Could someone help... (4 Replies)
Discussion started by: Felix2511
4 Replies
3. HP-UX
Hi
I am trying to make an executable which has informix esqlc and .per files. I am using informix version 9.3. The make is successful, but when i execute, i get an error message
/usr/lib/dld.sl: Unresolved symbol: ibm_lib4gl_loadint4 (code) from RVprnrecvr Abort(coredump)
I searched for... (4 Replies)
Discussion started by: venkatakrishnan
4 Replies
4. Shell Programming and Scripting
Hi Gurus,
I had a problem writing a pipe file.
Previously i used this code to generate a tab seperated file
ABCEF := ABCEF || 'to_char('|| abc_tab(col_num).col_name || ') chr(9) || ';
Now i want the o/p as pipe seperated file.I changed the line as below
ABCEF := ABCEF ||... (0 Replies)
Discussion started by: pssandeep
0 Replies
5. Solaris
deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies
6. UNIX for Dummies Questions & Answers
Hi all,
I need some urgent help with grep.
I'm simply trying to extract the current date from the syslog file, which is "Oct 6" and then grepping this and output the messages to a new log file.
See the below commands and output, even though the log file is created, it is created with all the... (8 Replies)
Discussion started by: wthomas
8 Replies
7. UNIX for Dummies Questions & Answers
According to linux hardening guide a PATH variable must not contain . or ..
so i grep the path variable using.
# echo $PATH | grep "."
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
# echo $PATH | grep ".."... (2 Replies)
Discussion started by: pinga123
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I would like to extract a pattern from a line. The first two characters will always be the same in this pattern, but the proceeding numbers will not be, and the pattern will always be 6 characters long. I would like to get the entire pattern up to a certain symbol, in this case, a period.
... (3 Replies)
Discussion started by: goodbenito
3 Replies
9. UNIX for Advanced & Expert Users
grep -E '^(++){5}5000' <file_name>
this command searches value 5000 in only 6th column from provided file where pipe ( | )is delimiter which separate columns... can some one plz explain me what '^(++){5}5000' actually does..? :confused: (1 Reply)
Discussion started by: Killer420
1 Replies
10. Shell Programming and Scripting
Hello,
I have multiple text files and I need to know which of them are having character issues.
Below command is not working. Maybe instead of that weird string, I should replace it with ascii code.
grep -A0 "�" file.txt
Thank you
Boris (10 Replies)
Discussion started by: baris35
10 Replies