CompuServe Thread

Stringing Commands

16 messages in this thread
#35533From: Tim CarterJun 24, 1993 4:56 AM
Is there a way to string commands in AmigaDOS like you can in Unix? For example, under Unix I can type pwd;ls;cd;clear at one time and the commands will be executed sequentially. How can this be done on the Amiga? Thanks.
#35556From: Marlene Zenker/SYSOPJun 24, 1993 4:52 PM
Yup…They sure can. Just type the command and then type a control-J character instead of hitting a return between commands. When you've typed the last command, type return and all the commands will be executed. Steve
#35562From: Tim CarterJun 24, 1993 10:49 PM
Thanks Steve, Will this work with script files as well? Tim
#35588From: Marlene Zenker/SYSOPJun 25, 1993 5:33 PM
Do you mean within scripts? I'm not sure what purpose that would serve… If you mean just executing script files one after another, yes it will. Steve
#35557From: Brian BartlettJun 24, 1993 5:40 PM
Tim, as far as I can tell, even with aliases, you cannot embed multiple commands, with the exception of backtick "`" commands, on a single line in AmigaDOS. AmigaDOS, for some reason, uses the semicolon, ";", character for comments. As it stands, you have two choices. Either give up multiple commands, or use a shell replacement such as CShell (scan the listings on CSH*, a C-Shell type replacement & my personal choice) or SKShell (a Korn-Shell replacement). I hope this helps. Brian
#35568From: Andy FinkelJun 25, 1993 1:05 AM
In addition to the control J method mentioned, you can also use the RUN command, and the + key, ie run list + dir + delete #? + echo "oops" The commands strung together won't be executed until the first one without the trailing + sign. andy
#35592From: Brian BartlettJun 25, 1993 11:14 PM
Andy, cute! Brian
#35598From: Tim CarterJun 26, 1993 5:15 AM
Andy, I tried the example you gave but it didn't work. I got two errors: No information for "+": object not found list failed returncode 20 Am I missing something here? Thanks.
#35605From: Andy FinkelJun 26, 1993 5:39 PM
Maybe my message was reformatted. Each command must be on a line of its own. The + sign must be the last thing on each line. so its The run command starts the whole thing off. So lets see if I can get this example across: run list + dir + echo "done" This will do a list, then a dir, then echo "done" andy
#35623From: Andy FinkelJun 27, 1993 6:35 PM
BTW, this is occasionally useful in a script file. (no, really 🙂 ) I usually use it to combine a WAIT and another command, like: run WAIT until 20:00 + say "Go Home" andy
#35625From: SyndesisJun 27, 1993 8:50 PM
That's what 'cron' is for!
#35635From: Andy FinkelJun 28, 1993 5:19 PM
Yes. I find it amusing that you can implement a cron-type program out of script files. I've got a fairly complete cron-as-a-script somewhere around, which I did for fun. andy
#35636From: SyndesisJun 28, 1993 7:16 PM
I tried that on my PC but it wouldn't do anything else until the event had passed… 🙂
#35646From: Andy FinkelJun 29, 1993 9:00 PM
Well, you probably haven't upgraded to a Pentium yet. 🙂 andy
#35656From: SyndesisJun 30, 1993 8:41 AM
I've heard it will busy-wait almost ten times as fast as a 486.
#35631From: Tim CarterJun 28, 1993 1:03 AM
Thanks Andy. Yes, your original example was formatted as one line. I tried your second one and it works. Thanks.