Test your Shell Scripting Skills: – Program 14

scmuser created the topic: Test your Shell Scripting Skills: – Program 14
Devise a script that allows a user to view, add, delete or modify a setting in a configuration file that contains these setttings in the form variable = value

Tagged :

Test your Shell Scripting Skills: – Program 15

scmuser created the topic: Test your Shell Scripting Skills: – Program 15

Devise a script that creates a lock file which prevents more than one user from running it. The lock file must be removed before script termination or if the user presses the interrrupt key.

Tagged :

Test your Shell Scripting Skills: – Program 16

scmuser created the topic: Test your Shell Scripting Skills: – Program 16

Assume that you have a number of files, downloaded from the internet, in the /home/kumar/download directory. The table of contents (TOC) is available in the file TOC_Download.txt in the form filename:description. The script should check each file in the download directory that does not have a description in the TOC file and prompt the user for the description. The TOC should be updated to maintain the list in sorted condition. The script must be immune to signals.

Tagged :

Test your Shell Scripting Skills: – Program 3

scmuser created the topic: Test your Shell Scripting Skills: – Program 3

Write a script that lists files by modification time when called with lm and by access time when called with la. By default, the script should show the listing of all files in the current directory.

renjith replied the topic: Re: Test your Shell Scripting Skills: – Program 3

#!/bin/ksh
if [ $# -gt 1 ]
then echo ” Usage list.sh [ml|la] { expected arguments lm or la or null } “;
fi

case $* in
lm) ls -lrt ;;
la) ls -lru ;;
“”) ls ;;
*) echo “Invalid argument ”
esac

Tagged :

Grep and Sed Questions with Shell script

scmuser created the topic: grep and sed questions with shell script
Search for a pattern with grep and sed and look for a file with find. Test the return value of each command when it displays no output. What conclusions would you draw?

Tagged :

Character validation in shell script?

scmuser created the topic: character validation in shell script?
Write shell code to accept a string from the terminal, and echo a suitable message if it does not have at least 10 characters using (i) case (ii) expr.

Tagged :