Okay everyone. I am working on a shell script but I want to use command line arguments instead.
For instance if I enter time 2 hours, the output should be 7200 seconds. This is what I have so far but it is using the read instead of argument. How can I rewrite this as command line argument?
seconds=0 echo -n "Enter number of seconds : " read seconds hours=$((seconds / 3600)) seconds=$((seconds % 3600)) minutes=$((seconds / 60)) seconds=$((seconds % 60)) echo "$hours hour(s) $minutes minute(s) $seconds second(s)"