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
Latest posts by scmgalaxy K (see all)
- Use of runtime variables to save into another variable using register in Ansible - September 6, 2018
- Ansible & Ansible Tower Variable Precedence Hierarchy - September 6, 2018
- How to use template in Ansible? - September 6, 2018