Skip to content
Snippets Groups Projects
Commit bd7c90eb authored by Holger Dinkel's avatar Holger Dinkel
Browse files

add more exercises: "Putting it all together"

parent e52f81db
No related branches found
No related tags found
No related merge requests found
......@@ -135,6 +135,21 @@ IO and Redirections
B. Next, use the :ref:`pipe <pipe>` symbol (`|`) and `sort` to sort this output *numerically*
Putting it all together
-----------------------
#. Create a new directory named ``myscripts`` in your homedirectory
#. Create an empty file named ``mydate`` in the newly created directory
#. Add the directory ``~/myscripts`` to your ``PATH`` environment variable
#. Use ``echo`` in combination with Redirection/Append to write ''date'' into the file ``~/myscripts/mydate``
#. Change the permissions of the file ``mydate`` to be executable by you (and you only)
#. Run the file ``mydate`` (it should print the current date & time). Make sure you can run it from any directory (change to your homedirectory and just type ``mydate``).
Bioinformatics
--------------
......
......@@ -273,6 +273,37 @@ IO and Redirections
$ cut -f3 -d':' /etc/passwd | sort -n
Putting it all together
-----------------------
#. Create a new directory named ``myscripts`` in your homedirectory::
$ mkdir ~/myscripts
#. Create an empty file named ``mydate`` in the newly created directory::
$ touch ~/myscripts/mydate
#. Add the directory ``~/myscripts`` to your ``PATH`` environment variable::
$ export PATH=$PATH:~/myscripts
#. Use ``echo`` in combination with Redirection/Append to write ''date'' into the file ``~/myscripts/mydate``::
$ echo "date" >> ~/myscripts/mydate
#. Change the permissions of the file ``mydate`` to be executable by you (and you only)::
$ chmod u+x ~/myscripts/mydate
$ chmod go-x ~/myscripts/mydate
#. Run the file ``mydate`` (it should print the current date & time). Make sure you can run it from any directory (change to your homedirectory and just type ``mydate``).::
$ mydate
Congratulation, you've just created and run your first shell script!
Bioinformatics
--------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment