[Solved] Reusing a 'NOT' command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [Solved] Reusing a 'NOT' command
# 1  
Old 10-20-2011
[Solved] Reusing a 'NOT' command

Hi Guys

I'm trying to search for all lines that that do not contain the dash (-) in it.

eg - I have the following list of numbers.I want to see those that donot contain the (-) in it.In this case '20151'
Code:
20151-60882
20151-60883
20151-60891
20151
20151-60893

Thanking you in advance.

Last edited by zaxxon; 10-20-2011 at 09:18 AM.. Reason: code tags
# 2  
Old 10-20-2011
Using grep:
Code:
grep -v - file

# 3  
Old 10-20-2011
You can try the grep command. The -v switch will negate the pattern you are looking for.
# 4  
Old 10-20-2011
Thanks guys.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[Solved] sed command help

Hello all. Im trying very hard to figure this out, but Im a newbie. I have a file that looks like this.... 6315551234 NJ224 5162224567 SUFF Im trying to put a command together that will make it into this.... UM,6315551234,,,,,NJ224,0 UM,5162224567,,,,,SUFF,0 Im all over the... (7 Replies)
Discussion started by: jay11789
7 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Finger command

Hi, I am writing script to take last logon user id detials by using finger command. But I am getting below output. wer34 Feb 10:23 I NEED to display wer34 Feb 10 2013 10:23, Is there any way to get like this. (18 Replies)
Discussion started by: stew
18 Replies

3. Shell Programming and Scripting

Reusing a variable in a script

I was breaking my head for a day still not successful I have variable x for following is assigned x=awk '/_.*successful/{getline;getline;getline;print}' log filename | awk '{print $2}' echo "$x" 2341I have this piece of code inside a loop which runs n times. I want to print... (7 Replies)
Discussion started by: rpm120
7 Replies

4. Shell Programming and Scripting

[Solved] Setfacl command help

HI, How to use setfacl for a domain user? I have an AD domain name manjunath and a domain user of the same domain named boarduser1. My cluster is joined to the domain. I am trying to set ACL for the boarduser1 on a file. I have tried this: setfacl -m u:Manjunath\boarduser1:rwx <file>... (1 Reply)
Discussion started by: prinsh
1 Replies

5. Shell Programming and Scripting

[SOLVED] sed command

Help request, I have tsted this line of code for hours. The first line works and the second line returns the message " sed: command garbled.....". This is running on solaris. The "${} variables all have good values when echoed. ## /bin/sed -n '1,25p' ${file} >> ${MailFile} ... (3 Replies)
Discussion started by: millerg225
3 Replies

6. UNIX for Dummies Questions & Answers

[solved]Help with a sed command

So I have a bunch of strings in a file. Example Line ./prcol/trt/conf/conf-app/jobdefinition/trt-pre-extr-trt-step.jdef Intended Result pre-extr-trt-step So far I have parsed it out to the last bit, echo $line | cut -d'/' -f7 | cut -d. -f1Result trt-pre-extr-trt-step So I added a... (2 Replies)
Discussion started by: J-Man
2 Replies

7. Shell Programming and Scripting

[Solved] Help with Sort command (ksh)

hello everyone, I have file with de-limited values in random order shown below, where C1V0 represents column1 value1, C2V0 represents column2 value 2, and so on. Column0 is a constant value which i didn't represent in the sample input format. Column1 is a numeric column. Column2 is a... (0 Replies)
Discussion started by: angie1234
0 Replies

8. HP-UX

[Solved] remsh command on hp-ux

hello, i have 4 hp-ux servers (srv1,srv2,srv3,srv4) srv1 is used to remsh srv2,srv3,srv4 /etc/hosts is configured on all servers and they can ping each other by ip,hostname and alies in srv2,srv3,srv4, .rhosts file is configured in user home with the entry: srv1 srv1_user ... (7 Replies)
Discussion started by: neemoze
7 Replies

9. Programming

FTP - reusing data connections

Hi there, This may be a stupid question, but... Is it possible to use one data connection channel initiated on a FTP server for sending multiple commands (LIST, NLST, MLSD)? Thanks in advance! (1 Reply)
Discussion started by: Yezu
1 Replies

10. UNIX for Dummies Questions & Answers

extracting text and reusing the text to rename file

Hi, I have some ps files where I want to ectract/copy a certain number from and use that number to rename the ps file. eg: 'file.ps' contains following text: 14 (09 01 932688 0)t the text can be variable, the only fixed element is the '14 ('. The problem is that the fixed element can appear... (7 Replies)
Discussion started by: JohnDS
7 Replies
Login or Register to Ask a Question