![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unresolved symbol problem | venkatakrishnan | HP-UX | 4 | 01-25-2008 02:39 AM |
| Problem with NFS & rpc.lockd-Help Needed | theologic | AIX | 1 | 09-21-2007 01:36 AM |
| Help Needed in Grep Command | ranga27 | UNIX for Advanced & Expert Users | 7 | 09-11-2007 09:20 AM |
| Help with tail /grep needed | Felix2511 | UNIX for Dummies Questions & Answers | 4 | 05-17-2007 03:22 PM |
| fread64 fwrite64 compilation problem (undefined symbol) | Isax50 | High Level Programming | 3 | 08-16-2005 03:26 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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. |
|
||||
|
this is most definitely not the homework question, only 1 line of code in a larger script that basically uses circular shifting to move the first word to the end of the string repeatedly and later on post the results.
noise.dat is a file created that contains the a an and or sample.out contains (created by the script i wrote) Analysis Software Requirements and Filters Pipes Filters Pipes and Java Swing Pipes and Filters Requirements Analysis Software Software Requirements Analysis Swing Java I didn't realize that ^ cannot be used with an input file, and is only associated with strings, Ill keep going at it. I guess Ill add some kind of if statement in my script to just get rid of any strings that begin with any of the "noise.dat" contents, since grep is being elusive. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|