stewartw@cognos.UUCP (Stewart Winter) (12/14/89)
Does anyone out there know how to make the ALIAS command of NEWCLI support a sequence of commands. For example on UNIX, I could alias abc 'cd Games: ; run hisGame' I realize that the ';' denotes a comment to the NEWCLI. Is there a separator that can be used? I couldn't find anything in the docs. Stewart -- Stewart Winter Cognos Incorporated S-mail: P.O. Box 9707 VOICE: (613) 738-1338 x3830 FAX: (613) 738-0002 3755 Riverside Drive UUCP: uunet!cognos!stewartw Ottawa, Ontario "The bird for the day is .... nanday conure." CANADA K1G 3Z4
wfh58@leah.Albany.Edu (William F. Hammond) (12/17/89)
In article <7728@cognos.UUCP>, stewartw@cognos.UUCP (Stewart Winter) writes: > > Does anyone out there know how to make the ALIAS command of NEWCLI *** First, a technical point: the native CLI (opened by "newcli" or the CLI icon in the WorkBench "System" drawer) does not support command aliasing. *** > support a sequence of commands. For example on UNIX, I could > > alias abc 'cd Games: ; run hisGame' > > I realize that the ';' denotes a comment to the NEWCLI. Is there > a separator that can be used? I couldn't find anything in the docs. > Stewart Winter Cognos Incorporated S-mail: P.O. Box 9707 > VOICE: (613) 738-1338 x3830 FAX: (613) 738-0002 3755 Riverside Drive > UUCP: uunet!cognos!stewartw Ottawa, Ontario *** There are a number of command shells for the Amiga that have a good bit of the functionality of, say, "csh" in UNIX. Since the ARP shell is freeware, I will respond to the question for that environment by giving two examples of working alia (aliases?). The first invokes subshells in which "avail" and "date" are run: (1) alias ta echo " \$(avail total) \$(date)" Here '\' is the ARP escape character (an environmental variable that must be "set"). If this is done directly from the command line these escapes should be omitted. Note that although aliasing itself is not recursive, aliases could be used inside the subshell parentheses. (2) set ac "address command" alias esc echo "\x3b" noline alias ais rx '$ac "info"\$(esc)$ac "status full"\$(esc)$ac "avail total"' In this example ARexx(tm) (not freely distributable -- but inexpensively priced and widely reported to be part of WorkBench 1.4) is used to assemble three command lines under a single alias. The environmental variable "ac" is used to save typing. The alias "esc" functions in subshells to insert semi-colons in such a way that they will not be interpreted as comment introducers by the command line. Thus, we have a three line ARexx script wired as a one line alias. ------------------------------------------------------------------------ William F. Hammond Dept. of Mathematics & Statistics 518-442-4625 SUNYA, Albany, NY 12222 wfh58@leah.albany.edu wfh58@albnyvms.bitnet -------------------------------------------------------------------------
barrett@jhunix.HCF.JHU.EDU (Dan Barrett) (12/18/89)
In article <7728@cognos.UUCP> stewartw@cognos.UUCP (Stewart Winter) writes: >Does anyone out there know how to make the ALIAS command of NEWCLI >support a sequence of commands. For example on UNIX, I could > alias abc 'cd Games: ; run hisGame' A quick solution would be to make a script file instead of an alias. Edit a file called "abc", and put the lines: cd Games: run hisGame into it. Put the file "abc" into a directory in your search path: copy abc Some_Directory_In_Your_Path Finally, set the script bit on the file by typing: cd Some_Directory_In_Your_Path protect abc +s You now have an "abc" command as given above. Dan //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | Dan Barrett, Department of Computer Science Baltimore, MD 21218 | | INTERNET: barrett@cs.jhu.edu | UUCP: barrett@jhunix.UUCP | | COMPUSERVE: >internet:barrett@cs.jhu.edu | BITNET: barrett@jhuvms.bitnet | \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////