This topic is part of our Linux Network Services and Security training
Even though Linux has a lot of commands, sometimes it is necessary to write simple (and some not so simple) scripts when we have to automate jobs.
The Bash shell is capable of running scripts and it also possible to write scripts in the various programming languages that exist in Linux (such as AWK, Python and Ruby).
The following scripts need to be written and tested:
- booklist
Manage a book database: print, insert, select, delete, update - compareperm
Check whether two files have the same permissions
Usage: compareperm file1 file2 - findhardlinks
Find links (not symbolic) to a given file
Usage: findhardlinks file [directory] - largestfile
prints the largest file in a directory
Usage: largestfile directory - summarise
prints number of normal files, directories and symbolic links
summarise directory. Two versions of the script can be written: one that does three passes through the files and can be slow and a second version which only does one pass through the files and, consequently, is quicker. - anagrams
finds and prints all the anagrams in /usr/share/dict/words. The technique used was described by Jon Bentley in his magnificent book, Programming Pearls.
This topic is part of our Linux Network Services and Security training
Leave a Reply