I'm trying to acquaint myself with shell scripting by following this
guide and am getting stuck testing out this script.
All I want it to do is have the script loop continuously, and when I type in a command and 2 optional arguments, it performs the task. Simple way of testing whether I've "got it" or not.
Am I using the cut command properly?
Is [ ] usable when trying to cut by blank spaces?
Am I using case right?
Is there a way I could have the loop exit if I press ctrl-c or something like that?
while [ read line ]
command="$(echo $inputline | cut -d[ ] -f1)"
arg1="$(echo $inputline | cut -d[ ] -f2)"
arg2="$(echo $inputline | cut -d[ ] -f3)"
case $command in
copy) & cp &arg1 &arg2