Learning BASH 2

Learning BASH 2

Further to my previous post on BASH.  I have been learning a little more about file manipulation.   Repl.it provides a really good platform for not only development but sharing projects etc with others including the repl.it community.

Note: I am using chromium browser to use the repl.it website as something does not work properly in Firefox.

To make the most of these projects, it would probably be a good idea to sign up.  If you use this link then it helps me by giving me more hacker plan credit and other rewards.  Once you have signed up you get a similar link to invite your friends with.

The normal link to the website is here.

My most recent project centres around manipulating the contents of files in this case I have created a text file that contains a list of Debian release code names in a random order.

In this context the cat (concatenate) command reads in a files contents, then can either output to the screen or output to another file or other commands.

The script

1. Reads in list.txt

2. Prints this to the screen as is (unsorted)

3. Redirects list.txt via sort command:

4 Write sorted content to list2.txt

5  Print list2.txt to the screen in alphabetical order


Note : If the embed does not work properly (see above note) please use the link below

https://repl.it/@zleap/newbashsh

Please feel free to discuss further via the repl.it forums or via twitter @zleap2018.  You may also want to follow @replit.

I can also be contacted on friendi.ca

 

Part 3 tomorrow.