Welcome, Guest. Please login or register.

Author Topic: Pipe AmigaDOS command into shell?  (Read 3229 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline LoadWBTopic starter

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Pipe AmigaDOS command into shell?
« 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?
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Pipe AmigaDOS command into shell?
« Reply #1 on: September 03, 2006, 09:57:44 PM »
- Grab 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.
 

Offline LoadWBTopic starter

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Re: Pipe AmigaDOS command into shell?
« Reply #2 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.
 

Offline AmigaMance

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 1278
    • Show only replies by AmigaMance
Re: Pipe AmigaDOS command into shell?
« Reply #3 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.
A1200 PPC user.
 

Offline nicomen

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 57
    • Show only replies by nicomen
    • http://home.polarboing.com/nicomen
Re: Pipe AmigaDOS command into shell?
« Reply #4 on: September 04, 2006, 01:52:21 AM »
If you are using AmigaOS 4 this works out of the box.
UtilityBase.com - Your Guide To Amiga Development
#amigadev @ irc.utilitybase.com
 

Offline LoadWBTopic starter

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Re: Pipe AmigaDOS command into shell?
« Reply #5 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!