#Shell & stuff
21 messages in this thread
Hi Don, I've picked up a few goodies from Usenet..but since I've been off the
net here for quite a while I thought I'd check with you about whether they've
been posted yet. First, I just picked up the executable and documentation for
Matt Dillon's Shell version 2.05m. New stuff includes command line editing
(you can still use "!nn" or "!str" to recall commands, the new feature is that
you can use the up & down arrows to go back and forward in the history list &
the left/right arrows & insert/delete character to edit the command line).
Also, true path support has been added as well as recursive copy and delete
(ie: you can copy an entire set of subdirectories) and sorted directories and
an "exclude" option on directory listings. I don't have sources for 2.05m
yet…they were truncated on my Usenet node. I was going to upload 2.04m
sources but I'll wait for 2.05m.
Perry Kivolowitz (ASDG) recently posted his recoverable ram disk driver and
other utilities to Shareware. He asked anyone having Compuserve access to post
it here also.
Let me know whether you already have these things and, if not, I will upload
them.
Rick Schaeffer
Rick,
I think you intended this for me since it was addressed to Don…
Anyway…upload away…we'd like them all.
Don
Rick,
I just grabbed the rcoverable ramdisk from Perry off UseNet last night, but I
havn't had time to upload it yet.
Regards, Larry.
Rick:
Please do! I noticed that Don already responded. Do you know if Matt
or anyone else has taken care of the '! <CR>' 'bug? Are you using the Shell?
73s,
bill
Yes, that one was fixed in 2.04m I believe. At any rate there seems to be few,
if any, bugs in this release. It appears to be real clean.
Rick Schaeffer
Thanks Rick! I'll download it this week if I don't have to leave for San Diego
right away. This shell seems super. I am not at all used to it yet and have
not done much shell programming. Is there anyone around that is really
knowledgeable about it? You possibly? If so I have some questions.
73s,
bill
Rick,
What is the meaning of the '%' in the shell? In the Alias example:
alias xxx "%i echo this $i is a test"
Is the '%' use to identify a passed variable on the command line? If
so, how many passed parameters can be on the command line? There is no
discussion of the '%' symbol in the docs. In other places in the documentation
the '%' looks as though it is the prompt.
How do you use the IF command to test for existence of a file on disk?
(I want to set up a conditional copy which tests for files existence before it
overwrites.)
Thanks, Steve
Steve:
When you get the answer to that one (IF exists) let me know. I was
trying to do the same kind thing and was not able to get it done. Alas if it
was only possible to get an improvement without loseing other features.
73s,
bill
Bill,
you can do something like this:
"%q foreach i ( * ) \"if $i = $q ; do something, etc.;endif\""
if you pass a filename to 'q', then you can search for it
and find a match. The '*' forces the foreach command to
search the current directory. It's inelegant and somewhat
slow, but works, sort of.
can you use the '%q' in a shell file? or is it only usable
in an alias? I haven't figured that one out yet.
73s
Steve W4YVP
Steve:
I am in the process of moving (again). I assume that the string that
you showed was the argument to an 'alias' command. May get a chance to try it
before I have to pack the AMI up again. At least it is going with me to San
Diego. Originally, I did not think I would be able to take it with me this
time. Where did you find out about the '*' command, in the 'docs'? If so,
then I must have missed that one.
73s,
bill
Rick,
I also would like to suggest that the current directory be displayed in
the prompt, because a command can no longer be used for the prompt display.
Steve
That sounds like a good idea, Steve. I will pass it on to Steve Drew via
Usenet. As I do not yet have the source, there isn't much I can do about it.
Hopefully, Steve will re-post it since *lots* of nodes besides the one I use
reported that the source "shar" file was truncated somewhere along the line.
As to the problem with checking if a file exists…I haven't had an opportunity
to try that one out so I'll have to get back to you on it.
Rick Schaeffer
Rick,
Thanks, I appreciate that. The shell has improved quite a bit since
2.0 and probably needs just a little tweaking here and there. My main thoughts
were that the internal commands could more closely mimic what the DOS commands
did, especially when the shell doesn't provide an alternative, as with the IF
EXIST example.
STeve
Steve,
I don't know if you are aware of the feature, but you can use a different
capitalization in order to tell the shell that you want to use the command in
your C: or current directory.
To see what I mean, type:
Dir
. the shell will assume you want an external command and will dispatch it to
the OS.
Regards, Larry.
Larry,
UNIX ™ and work-alikes are all case sensitive, which the Amiga is
not…and that's a good point to keep in mind in refernce to the CSH.
Don
I dropped Steve a line on Usenet…we'll have to wait & see if he has any
ideas. In the meantime, it should be possible to create a *real* short C
program, named "Exists" which returns non-zero when an attempted open of the
argument fails. It's a kludge…but a faster one than anything else I've been
able to come up with. I'll keep in touch!
Rick Schaeffer
Steve:
If enough of the Unix commands exist, who cares? For me anyway, the
AMI dos commands added some useful features not normally found in the micro
world but left out some that I really missed. The shell is providing the best
and most powerful 'CLI' even if it is a little painful to learn. The one that
I would like to see is a way to spawn a new CLI automatically run the shell and
a 'source.' 73s,
bill
I have a solution for that one! I have a real short script in my "s:"
directory called "startcsh". It consists of a few initialization statements
unique to my system and ends with the following two statements:
stack 8000 (this is optional)
csh s:.login
Now then, the .login script is my standard system startup. In it I have an
alias that looks like this:
alias newcsh newcli con:0/0/640/200/NewCsh From s:startcsh
When the shell is running, then, all I have to do to start another shell is
type "newcsh" and…Presto!…I get a new window all set up and running the
shell. It even has a title of "NewCsh" instead of New CLI!
By the way, there is a PD utility called "xicon" (probably in one of the DL's)
which allows you to use an icon to execute a CLI script. Sooo, I have an icon
named "Csh.info", and a file called "Csh" which is a CLI script containing one
line:
newcli "CON:0/0/640/200/CShell Window" From s:startcsh
This replaces the "CLI" icon and file on my workbench and gives me an icon that
directly brings up the CShell! Best of all possible worlds, eh?
Rick Schaeffer
Steve:
I sure do hope you stick around on CIS. I can see right now that
knowing you will save considerable time and money! Thanks again! I'm real
liberal about the stack, usually about 10Ks worth. I did not know about the
'from' command for a new CLI! Where is that one documented?
73s,
bill
The "from" command is new for 1.2. It is documented in the "Enhancer" manual.
It's a really nice feature!
Rick Schaeffer
PS: I've been around CIS for nearly as long as there's BEEN a CIS! Not likely
to be leaving anytime soon <grin>.
Rick
Hi again, Bill. I saw from another of your messages that you are (were) a
Heath user. Well, my first Micro was a Heath H8 (1977). I, too, am very fond
of HDOS! I still have and use an H100…and the old H8 was given to an old
friend who is *still* using it every day. I also still have my old H9 terminal
(need a good boat anchor?). Used to spend all my CIS time in the HUG sig but
haven't been up there in quite a while since I got my Amiga.
Rick Schaeffer