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
Category: Shell Script
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.
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.
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
$# and $* Questions
scmuser created the topic: $# and $* questions
If a script is run as foo -l -t bar [1-3], what are the values of $# and $*? does it make any difference if the options are combined?
Exit status of command
scmuser created the topic: Exit status of command
What are the exit status of a command? what is its normal value and where is the value stored?
tty terminals related script??
scmuser created the topic: tty terminals related script??
Develop script logic that allows only romeo and henry to execute a program, and only from the terminals tty05 and tty06
Df and Du issues with script
scmuser created the topic: df and du issues with script
A script named test containing the df and du commands displays nothing when executed. Why does that happen? state two ways of making the script behave properly.
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?
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.