Grep not working on mac


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Grep not working on mac
# 22  
Old 01-16-2015
If your sed supporte -b option:
Code:
sed -b '/^\r$/d' Endonuclease_GO-0004519_Filter.csv | head

# 23  
Old 01-16-2015
Using BSD sed: substitute the carrage return character with nothing; terminate the last line of the file with the new-line character; remove any blank lines and save the results in a new file.

Code:
/usr/bin/sed -e $'s/\r//g' -e 'a\' -e '/^\s*$/d' FILE > NEWFILE

This should work with gnu sed.
# 24  
Old 01-17-2015
Try:
Code:
tr -d '\r' < Endonuclease_GO-0004519_Filter.csv | awk NF

---
Note: Only GNU sed understands \r Regular sed does not..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cat command not working to display Mac file in Ubuntu

Hi, Recently I got a .txt file from Mac user. when I try to open it in my Ubuntu machine using cat command it is not displaying any content of file however I can see the content using vi. Anyone know How to see its content using cat as I have to process it in my shell script. Thanks in... (4 Replies)
Discussion started by: diehard
4 Replies

2. Shell Programming and Scripting

GREP mac address

Hi, mac.txt My mac address is <Mac Address>. How can i replace <Mac Address> with the actual of my computer? I try to GREP command as below but i am unable to grep it to replace just <Mac Address>. ifconfig eth0 | grep -o -E '(]{1,2}:){5}]{1,2}' Million in Advance. Please use... (7 Replies)
Discussion started by: derrickyee81
7 Replies

3. Shell Programming and Scripting

pbpaste and grep with Mac X11

Hello, Here is what I am trying to do: 1) Copy a string to the pasteboard using Command-C 2) Search for the string in a file in X11. Command-C pbaste | grep - filname (does NOT work) What is the correct syntax? Thanks! (4 Replies)
Discussion started by: palex
4 Replies

4. UNIX for Dummies Questions & Answers

Grep /Awk letters X - X in every line and print it as a mac address

hey i m kinda new to this so i will appreciate any help , i have this list of values: pwwn = 0x50012482009cd7a7 nwwn=0x50012482009cd7a6 port_id = 0x280200 pwwn = 0x5001248201bcd7a7 nwwn=0x5001248201bcd7a6 port_id = 0x280300 pwwn = 0x50012482009c51ad nwwn=0x50012482009c51ac port_id =... (4 Replies)
Discussion started by: boaz733
4 Replies

5. Shell Programming and Scripting

GUI Shell Script Mac OS X - Working Directory

Hi. I'm pretty new to shell scripting. All I want to do is have a simple shell script that opens a python script from the GUI i.e. when I double click the shell script it will launch the python file. However when I try to do this it looks for the python file in my home directory, I have tried... (1 Reply)
Discussion started by: whatg
1 Replies

6. Shell Programming and Scripting

grep not working ????

Hi, I've prob in doing grep. I want to grep line staring with number 531250 in the 1st column from a file (example in picture attached below) using command grep -w "531250" file my ideal result should be 531250 1 21 42.1 100 1e-05 ... (8 Replies)
Discussion started by: masterpiece
8 Replies

7. UNIX for Dummies Questions & Answers

rm /var/db/.AppleSetupDone no longer working for mac OS X 10.6??!? HELP!!!!

My roommate forgot his admin password on his MacBook air.. He doesn't have the external SuperDrive, so we have no way of using the simple method of using the install disks and resetting the password.. The worst part is, he did this same thing about a year ago lol At the time, we booted... (0 Replies)
Discussion started by: PhiGam
0 Replies

8. OS X (Apple)

Postfix in Mac OS X 10.5 not working

I'm currently working on a project that would need to send email from my list of users. Based on the search I've done, I could send formatted email from my server using Postfix. I setup my mac adding a few lines below: /etc/hostconfig MAILSERVER=-YES- /etc/postfix/main.cf ... (1 Reply)
Discussion started by: airman_ole
1 Replies

9. UNIX for Dummies Questions & Answers

grep not working

This condition is not able to grep , can any one tell what's wrong with this part. I am able to see from unix command but not with host script. echo "Checking for Loader Status " >> $REPFILE if test $? = 0 then echo "Successful termination of SQL*Loader "$LOADER1 >>... (5 Replies)
Discussion started by: u263066
5 Replies
Login or Register to Ask a Question