Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!rpi!leah!wfh58 From: wfh58@leah.Albany.Edu (William F. Hammond) Newsgroups: comp.sys.amiga Subject: Re: Alias and Command Separators Summary: (1) Use "$(command)" for a subshell in the ARP shell or (2) Use ARexx to put commands together Message-ID: <2306@leah.Albany.Edu> Date: 16 Dec 89 17:08:20 GMT References: <7728@cognos.UUCP> Organization: Dept of Math & Stat, SUNYA, Albany, NY Lines: 44 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 -------------------------------------------------------------------------