T.R | Title | User | Personal Name | Date | Lines |
---|
4220.1 | One technique | TLE::RMEYERS | Randy Meyers | Wed Oct 24 1990 14:06 | 8 |
| Re: .0
This works if you CD to a certain directory:
echo "Please type name of the directory"
cd >NIL: ?
The CD command will read its argument from standard input.
|
4220.2 | Not exactly what I was trying to do | 7415::GATULIS | Frank Gatulis 297-6770 | Wed Oct 24 1990 17:40 | 21 |
| re .-1
Randy,
I agree. I found a similar example but the restriction is that
"the name of the directory" is used immediately with the command.
There's no "memory/storage" where I can find out what the user typed
in so I can use his string more than once.
In the example you mentioned, ( CD >NIL: ? ) works because the users
input is only used once. How could implement something like:
if exists <user-directory>
cd <user-directory>
but only ask for input once (without a passed parameter) ?
Can it even be done?
Frank
|
4220.3 | Get AREXX | TENAYA::MWM | | Wed Oct 24 1990 18:08 | 9 |
| Since dos scripts don't have real variables per se, just return codes &
script parameters, you're using the wrong language. Try AREXX; it's cheap
now, and is bundled into 2.0.
If that won't work for some reason, try using one of the PD Unixoid shells
that are floating around (csh at least should be useable), or possibly
ScriptIt or something similar.
<mike
|
4220.4 | Closer to what you need? | TLE::RMEYERS | Randy Meyers | Wed Oct 24 1990 19:01 | 21 |
| Re: .2
> There's no "memory/storage" where I can find out what the user typed
> in so I can use his string more than once.
How about this hackful solution:
assign old-dir: ""
echo "Please type the name of the directory"
cd >NIL: ?
assign dir: ""
cd old-dir:
You can then use dir: everywhere you need the directory that was typed in.
(The AmigaDOS trivia in the above is that the filename "" is the a synonym
for the current directory.)
It's possible to improve on the above little script be using $$ to
make the CLI number part of the assign name, and thus the script
can multitask with itself. See the 1.3 docs for details (I don't
remember them offhand).
|
4220.5 | Clean up | TLE::RMEYERS | Randy Meyers | Wed Oct 24 1990 19:06 | 8 |
| More on .4:
Remember to cancel the assigns before ending your script:
assign old-dir:
assign dir:
That way you don't have dangling locks on directories.
|
4220.6 | | HPSCAD::GATULIS | Frank Gatulis 297-6770 | Wed Oct 24 1990 19:27 | 15 |
|
Re -.3 & -.4
Sounds obscure eough to work. I'll probably give it a shot. I have
another weird idea about trying a kludge with environment variables
as a place to store a string.
Re -.2
ARexx! Naaaaaaa. I'd sooner write real code to do the job.
Thanks for the replies.
Frank
|