Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
> Easy for you but not for me!
post Mar 7 2015, 10:00 AM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 7-March 15
Member No.: 18,845

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.
Go to the top of the page
+Quote Post
Start new topic
post Mar 8 2015, 10:18 AM
Post #2

Its GNU/

Group: Support Specialist
Posts: 1,803
Joined: 23-January 03
Member No.: 360

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.

Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 17th January 2018 - 07:01 PM