Blog focuses on Linux, open source software, cyber security, futuring, innovation, systems engineering, Africa, and other items related to technology.
Thursday, May 31, 2012
Tuesday, May 22, 2012
My CTU Stories Profile Displayed
Excited to see my profile on the CTU Stories website. View my profile at http://ctustories.com/posts/view/575 or click on image and you will be redirected to my profile.
View more of my items at the following below:
Linkedin Profile: http://www.linkedin.com/in/mauricedawson
Twitter Profile: http://twitter.com/#!/drmauricedawson
AAMU Research Profile: http://aamu.academia.edu/MauriceDawson
Visual CV Profile: http://visualcv.com/drdawson
Academic Experts Profile: http://www.academicexperts.org/profiles/MauriceDawson/
View My Colorado Tech Faculty Publications: http://library.colorado-tech.com/facultypubs/Dawson.htm
Monday, May 21, 2012
Friday, May 18, 2012
Thursday, May 17, 2012
How to Write a Shell Script Using Bash Shell in Ubuntu: 10 steps
How to Write a Shell Script Using Bash Shell in Ubuntu: 10 steps [article taken from the Anil Mahadev & 4 others]
We shall cover a simple example. How to create a Shell Script that displays the list of files present in a directory
Ever wanted to Automate operations in your OS? Ever wanted to write a program that could create a file, copy that file to a directory? And using the Famous BASH Shell in Ubuntu? If the answers to both these questions areYes!, then this is the How-To for you!
We shall cover a simple example. How to create a Shell Script that displays the list of files present in a directory
EditSteps
- 1Launch the Terminal by clicking on Applications --> Accessories --> Terminal
Run Bash Scripts
Run and Schedule Routine Tasks across cloud and non cloud servers.
www.scalextreme.com - 2Next in the Terminal launch the vi/vim editor. My fav is vim.
- 3In the terminal window, type
vim ListDir
.sh
and hit enter. Once inside the Editor, type "I" or "i". This will allow you to insert / start typing your shell script. - 4At the top type the following code
#
!/bin/bash
. This is known as a Shebang line - 5Now type the code as shown in the figure
- 6Now to come out of the vim editor, type the following key combinations, Esc, : , wq! This will write the changes to the file and bring you back to the terminal.
- 7Now we need to make this Shell Script, executable. To do this, enter the following command
- 8chmod +x ListDir.sh and hit enter. You can see the results below
- 9To run this Shell Script, simply type ./ListDir.sh . You should get the list of directories and the message as shown below
- 10Congratulations on writing your 1st Shell Script using Bash in Ubuntu Linux!
Subscribe to:
Posts (Atom)