Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ General Discussion _ Easy for you but not for me!

Posted by: cwilso99 Mar 7 2015, 10:00 AM

I am doing an assignment and I need help, I have tried a bunch of different things. Here is the question:
Combine the two files together in alphabetical order (use the sort command), with the results displayed on the screen. Each occurrence of the word Windows should be replaced with the phrase unstable OS. Show the command you used.
File 1
Windows NT
Open BSD

File 2
Windows 2000

I keep coming back to these commands but I can't seem to get it right, I am trying to pipe them together

sort -d file1 file2 > file3 | sed s/Windows/unstable OS/ file3

Any suggestions? This just makes a file3 in alphabetic order and doesn't change any words or display anything on the screen. Thanks for any help.

Posted by: michaelk Mar 8 2015, 10:18 AM

The first error is writing to the file before piping it to sed. The result is that sed has nothing to do.

sort -d file1 file2 | sed 's/Windows/unstable OS/'

There are probably several methods to display the results and write to the file. I do not know what commands you have already learned and forums are not for blindly doing homework for others so will leave the rest to you.

Posted by: addseo1115 May 1 2015, 01:42 AM

haha topic name is funny

Posted by: ronaldlee Jul 22 2017, 02:28 AM

Thanks for the post

Posted by: janifarlee Sep 8 2017, 02:12 AM

Hello, i am new user what you shared ??


Posted by: hinterfeld Mar 27 2018, 04:59 AM

your post nice

Posted by: Ubom May 27 2018, 12:57 AM

Posted by: johnshaw602 Jun 1 2018, 12:21 AM


Powered by Invision Power Board (
© Invision Power Services (