English Amiga Board


Go Back   English Amiga Board > Support > New to Emulation or Amiga scene

 
 
Thread Tools
Old 11 May 2015, 05:36   #1
mrrhq
 
Posts: n/a
[AmigaDOS] How to pipe output to argument?

Hey, I'm using FS-UAE and I want to pipe some output into WHDLoad. I'm using the version of AmigaDOS that either comes with the Kickstart, or the emulator (AROS) I'm not sure.

Anyway, I unpacked the WHDLoad archive, and now I created my own start HD0:S/Startup-Sequence file, which executes when the emulator first starts. I also have a Workbench 3.1 directory thanks to Amiga Forever.

What I want to do is pipe the output of the command:
Code:
Dir "DH1:/#?.slave"
into the WHDLoad program. I've tried lots of things, using the TO directive, trying PIPE: and I'm not sure how to do this.

Most of my commands have gotten the same error: Wrong number of arguments
I'm really not familiar with AmigaDOS. Piping is very confusing compared to Linux or MS-DOS.

Here is, for example, things that I have tried, and failed to get working:

Code:
Dir DH1:/#?.slave TO WHDLoad
Code:
Dir DH1:/#?.slave > slavename.txt
WHDLoad < slavename.txt
Code:
Copy PIPE:DH1:/#?.slave PIPE:WHDLoad
Sorry, I don't know what else to do. I've spent a few hours trying to get this to work...
 
Old 11 May 2015, 07:03   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
I don't think you want to pipe the output to the standard input of WHDLoad, but rather put the output on the command line as arguments to WHDLoad:
WHDLoad `Dir DH1:#?.slave`
Leffmann is offline  
Old 11 May 2015, 08:06   #3
mrrhq
 
Posts: n/a
Yes, that's exactly what I want to do. Except that the backticks do not work. I swear, is something wrong with the AmigaDOS I'm using, too? I wish I knew...
 
Old 11 May 2015, 08:18   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,030
You have to use the right backticks (0x60).

And Dir is certainly not the right command because it does not include the path in its result. Use this instead:
Code:
WHDLoad `list DH1:#?.slave lformat=%p%n`
thomas is offline  
Old 11 May 2015, 11:00   #5
mrrhq
 
Posts: n/a
Thanks for your help guys, your command worked fine in my Workbench install, but I think the way I'm doing it is not going to work out. I'm trying to save as many resources as possible. What I'm doing is copying over the List, Dir, and other commands from a Workbench 3.1 install to the extraced WHDLoad directory.

I have FS-UAE set up to use WHDLoad as the "hard drive", which works fine, but when I use the backticks or lformat, it wants me to use a ramdisk... Oh boy.... That means I have to write my own custom Startup-Sequence file.

After commenting out a bunch of stuff, I tried this:

Code:
C:MakeDir RAM:T RAM:ENV RAM:ENV/Sys
Assign >NIL: ENV: RAM:ENV
Assign >NIL: T: RAM:T
;Path >NIL: RAM: C: S:
SetEnv Language "english"
C:WHDLoad `List DH1:#?.Slave lformat=%p%n`
EndCLI >NIL:
When WHDLoad runs in FS-UAE I get an error message saying: DOS-Error #205 (object not found) on locking "data"

Some people are saying too much memory is used, but I can't unallocate the memory when I need it, so I feel like I'm being shoved backwards from solving this problem. Darn.
 
Old 11 May 2015, 11:34   #6
mrrhq
 
Posts: n/a
Oh... my gosh, it was because I needed to cd into DH1: for some reason... Wierd. Sorry. I added 8MB fast RAM too, just in case.

Here's a solution for someone who can download WHDLoad, and extract the archive, and can copy the List and Shutdown command (probably the AROS commands work fine too) they need to be copied in to WHDLoad/C, and then create the file WHDLoad/S/Startup-Sequence:

Code:
; Custom Startup-Sequence

C:MakeDir RAM:T RAM:ENV RAM:ENV/Sys
Assign >NIL: ENV: RAM:ENV
Assign >NIL: T: RAM:T
SetEnv Language "english"
DH1:
C:WHDLoad `List #?.Slave lformat=%n`
Shutdown
Using this in FS-UAE:
Code:
hard_drive_0 = /path/to/folder/WHDLoad
If you, strangely like I do, use Linux and Midnight Commander, put this in mc.ext:
Code:
# Commodore Amiga A1200
regex/i/\.(ad[fz]|dms)$
    Open=fs-uae --floppy_drive_0=%f

directory/\(WHDLoad\)$
    Edit=fs-uae --hard_drive_1=%f

# Commodore Amiga CD32
regex/i/\(CD32\)\.cue$
    Open=fs-uae --amiga_model=CD32 --cdrom_drive_0=%f
I have it so when I press F4 on any directory I rename in MC with (WHDLoad) on the end, it will launch it. I can keep my games on a separate hard drive this way, which is exactly what I wanted.

Finally, since Shutdown will handle everything else, I have F10 to quit the game in my WHDLoad.prefs. You can change it.
Code:
QuitKey=$59         ;rawkey code to quit
Thanks everyone graciously for your help.

Last edited by mrrhq; 11 May 2015 at 11:41.
 
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to type pipe and backslash characters gryf support.FS-UAE 7 04 August 2015 23:47
Project: Blizzard 1230 IV - Heat Pipe Cooling System Yoto support.Hardware 45 17 December 2012 05:45
Amiga, vfork(), and pipe() tygre Coders. General 5 03 December 2011 01:35
Pipe Dream (original) MethodGit request.Old Rare Games 3 16 December 2010 22:17
Pipe Mania - AGA-fixed/1-filed by Galahad MethodGit request.Old Rare Games 10 28 May 2009 01:34

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:09.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07195 seconds with 13 queries