Amiga.org

Amiga computer related discussion => General chat about Amiga topics => Topic started by: LoadWB on September 03, 2006, 09:34:14 PM

Title: Pipe AmigaDOS command into shell?
Post by: LoadWB on September 03, 2006, 09:34:14 PM
In the Unix world, we enjoy such constructs as

{command to generate list of commands} | sh

In AmigaDOS, we have to

{command to generate list of commands} > t:tempfile
execute t:tempfile

For instance, trying to convert a bunch of DMS files to ADF, I used this command

list dms all files p=#? lformat "dms write %p%n to rad: nopause *n transadf drive rad: file adf/%p%m.ADF" > t:transdms
execute t:transdms

When what I would really like to do is something like

list lformat "{command}" | shell


How could I accomplish this?
Title: Re: Pipe AmigaDOS command into shell?
Post by: Piru on September 03, 2006, 09:57:44 PM
- Grab Pipe-1.5.lha (http://www.aminet.net/package.php?package=util/shell/Pipe-1.5.lha)
- Unarchive
- Copy Pipe/Pipe to c:
- add 'Resident ADD C:Pipe PURE' to user-startup if you have the system resources.
- edit shell-startup, and add
set _pchar "|"
set _mchar "&&"
- Make sure you have PIPE: mounted. If it's in Storage/DosDrivers, doubleclick it. If you want it permanent, drag the PIPE icon to Devs/DosDrivers.

Try by launching a new shell, and then:
1.> echo "echo foo*Necho bar" | execute in:

Read Pipe.doc for full documentation.
Title: Re: Pipe AmigaDOS command into shell?
Post by: LoadWB on September 03, 2006, 11:31:11 PM
Thank ya!  I'll have to check what version of PIPE I'm running now.  I have pchar and mchar set -- found that a long time ago, and it's great with Unix tools like grep, awk, etc.
Title: Re: Pipe AmigaDOS command into shell?
Post by: AmigaMance on September 04, 2006, 12:37:43 AM
@LoadWb
 I know how you feel. Unix is the best and it's good to have a part of it on your AmigaDOS. You might want to check CShell as well.
Title: Re: Pipe AmigaDOS command into shell?
Post by: nicomen on September 04, 2006, 01:52:21 AM
If you are using AmigaOS 4 this works out of the box.
Title: Re: Pipe AmigaDOS command into shell?
Post by: LoadWB on September 04, 2006, 03:18:36 AM
Quote

Piru wrote:

Try by launching a new shell, and then:
1.> echo "echo foo*Necho bar" | execute in:


Works like a charm.  Thanks!