06-07-2010
sed on Mac OS versus Linux
I'm trying to replace space with inderscore on Mac OS X 10.6.3
sed -i 's/ /_/g' somefile
sed: 1: "hsa_mirbase.fa": extra characters at the end of h commandThis works perfectly fine on Linux.
Thank you
Joseph Dhahbi
7 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Gurus!
I recently got my shell account (HP UX v11) created by our sysadmin and am having problem deleting with the backspace key.
After doing some reading, I believe I need to enter a custom "STTY..." statement in my profile.
Can someone please help me with the correct "STTY" sequence... (3 Replies)
Discussion started by: alan
3 Replies
2. Programming
Hi,
Unless I am missing some serious differences in Mac and linux in terms of C programming, I dont know why this would happen. Please take a look at the following piece of code fragment:
bool add_input_to_db(Cons *new_data) {
// Set the attributes of the lock
struct flock fl =... (3 Replies)
Discussion started by: newhere
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I've been trying to work out how to add a new line to a file when the pattern matches .dmg.
I've been searching Google but yet not found a working solution.
Help would be appreciated... (9 Replies)
Discussion started by: pburge
9 Replies
4. Shell Programming and Scripting
Does anyone have a script that can be run to tell you if you are on either a VM Linux or a physical Linux server? (15 Replies)
Discussion started by: bigbenn
15 Replies
5. Red Hat
I am being asked to use RHEL red hat instead of ubuntu. Are the basic commands the same? I know the licensing is different, but are the package mangers/repositories the same?
That is will sudo apt-get still be used? I have been using ubuntu for 4 years and have never used red hat so any... (5 Replies)
Discussion started by: cmccabe
5 Replies
6. Shell Programming and Scripting
Super basic question. I installed sed GNU on a MAC running High Sierra. However, when I run sed '1i>sometext, I get the following error:
sed: 1: "1isometext"; command i expects \ followed by text
I have added the \ with no success. Is there anyway I can run sed and awk on MAC in the... (5 Replies)
Discussion started by: Xterra
5 Replies
7. UNIX for Beginners Questions & Answers
Hello,
I am on a Mac and trying to clean up some monthly files with a very simple SED:
sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt
(from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file)
then output to output.txt
Even when I try... (2 Replies)
Discussion started by: verbatim
2 Replies