[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

521.0. "Shell 2.06M Available" by CGOU01::DREW (Steve Drew) Mon Jun 01 1987 19:32

    Now in CGFSV1::DISK$73G:[DREW.AMIGA.SHELL206M]
   			Shell_Doc.Shar	      ! Readme & docs.
     			Shell_Sources_n.Shar  ! 2 shar files of sources
			Shell_uue.Shar	      ! uuencode shell (_unix)
     			Shell_Unix.	      ! or binary if you prefer.
   	               *Shell_Amiga.	      !
    
    *	Again the only difference between shell_unix and shell_amiga
    is for convenience for us VMS types the unix command names cat,
    mv, rm, have been renamed to type, rename, delete. This of course
    could be changed also via aliases under shell. I only make this
    version available here. To the USENET & Fred Fish only the _unix
    version is sent. Also the Docs only mention the unix names.

    Following are some notes on new features from the readme file.
    The best improvment I made, (I think so anyway) is the recursive
    wildcarding. This gives a VMS stlye subdirectory search via df0:.../*
    And directories are sorted, faster, and can do a "ALL" via the 
    .../ specifier either muilti column short listing (dir -s df0:.../)
    or the default with file sizes & dates ect...
    
    Enjoy.
    
    Steve.
    


Version 2.06M notes: (new features)
-----------------------------------

	- Minor changes for 3.4a of manx. Slightly smaller executable.
          (That of was before the new features but still with all the
           improvments the execuatble has only grown by 400 bytes!!)
	- Bug fixes:
	    o New fexec code from 3.4a fixes many problems like some lattice
	      programs causing task helds, when invoked under shell.
            o Limit of 1 line of type a head fixed.
            o Added check in mkdir to see if file already exists.
            o If levels too deep protection added.(prevents potential crash)

	- Better Pathing:
          For all external commands including any 'run' from shell we
          first search $_path variable then search amigados path.
	- Added -a startup switch, turns of command line editing code 
	  for use with AUX or conman handler.
	- Added setfiledate on copy, but maybe disabled via -d switch.
  	- Also -u (update) switch on copy: if dest file is same name and 
    	  not older then don't copy.
	- copy command will now create the destination directory if it does
          not exist when specified as 'copy [-r] dir dir'. If you specify
          copy file file file dir, then 'dir' must already exist.

	- Added recursive wild card support via '.../' specifier eg.
	  dir df0:.../*.c will go down all levels of df0: matching on
          any .c file. or echo .../* will expand to all files down all
	  trees from our current level.

	- Exclude pattern matching support, in a limited way , only one
          exclude pattern per cmd line and for files not dirs.
          eg.  
           dir !*.info will 	  exclude all *.info files in current dir.
           dir df0:.../!*.info    full directory tree of df0: but exclude
                                  any ugly .info files.
          dir !*.o !*.c (will result in ALL files matching since what
          doesnt match the !*.o will match the !*.c)

	- Directories always sorted. Sorted directories before were slow
          since files were examined twice once by expand() and then by do_dir.
          Now everything is done by expand() and do_dir() only formats the 
          printed output. -e switch removed since expand does that now.
          eg.
           dir df0:.../           does a full (All) sorted directory
	
    
T.RTitleUserPersonal
Name
DateLines
521.1Small Bug fixedCGOU01::DREWSteve DrewWed Jun 03 1987 15:1211
    There's a newer version of shell 2.06M in dir mentioned in .0
    
    It's just a 2 line bug fix in main.c that solves console problems,
    echoing screwed up and such if you had redirected or piped any
    commands in your .login file. Dave Weckers .login file managed to
    shake this bug out. It took me a while last night to track that
    sucker down, (that's the bug, not Dave :-). Anyway you may want
    to recopy the executable and shell_source_2.shar. This fixed version
    will be the one sent to USENET.
    
    /Steve.
521.2The official 2.06M version now avail.CGOU01::DREWSteve DrewWed Jun 10 1987 14:3623
    
    I added another feature, (by popular request) that also made it
    under the wire to the USENET moderator. So the version you got today
    or soon from comp.sources.amiga/binaries is a improved version.
    Although I only post the _unix version to the USENET. This official
    2.06M version is also now in my directory specified in .0
    Actually I had put it there last friday but kept forgeting to mention
    it.
    Any way heres what changed:

    	- Passing an argument that contains a space to an external command
	  is now implement the same way as internal commands, also any
	  expansion of a file name that contains a space will be enclosed
	  in quotes before being pass to an external command.
              the following will now work correctly:
		  $ rm "foo bar"        this worked before
		  $ DELETE "foo bar"    needed "\"foo bar"\" before.
		  $ "my prog"	        would not work before	
		  $ myprog *		would not work with spaced files before
		  $ run "pro gram"	needed run "\"pro gram"\" before.
    
    Steve. 
    
521.3ANGORA::SMCAFEESteve McAfeeWed Jun 10 1987 16:4927
    Some minor shell questions:
    
    1.  Can I put an ESC char in a command?  It's probably backslash
        something but I haven't figured it out.  (I wanted to set my
        prompt to be highlighted.)
    
    2.  I have problems sometimes when I try to use an amigados command.
        For example:  search *.h text
                      search #?.h text      <---  Works from CLI
        these both come back with "bad command arguments".

    3.  I would like to delete some of the amigados commands which shell
        provides inherently, but I have one problem.  If I want to do
        something in the background (e.g. print a file), I might enter
    
        $ run type textfile prt:
    
        Obviously, if I delete the type command from c: this will fail.
        What I would like to do is something like the following:
    
        $ run shell "type textfile prt: ; quit"
    
        I'm probably missing something important...
    
    regards,
    
    steve mcafee
521.4Answers...while you waitCGOU01::DREWSteve DrewThu Jun 11 1987 02:3774
->    1.  Can I put an ESC char in a command?  It's probably backslash
->        something but I haven't figured it out.  (I wanted to set my
->        prompt to be highlighted.)

	use the carror ^ to insert any control character.
	eg ^G would be bell
	   ^L would clear screen
	   ^[ is <ESC>

	so:	$ set _prompt ^[[1m$" "^[[0m
	would give a bold dolar sign space as a prompt.
	
	Personally I alias cd to set my prompt to my current directory
	device volume. But aliases and such are very flexible.
	eg.
	
	alias cd "%q if $q; \\cd $q; else; echo $_cwd;endif;  ... join line..
		strhead q : $_cwd;set _prompt $q\\>\" \";"

	The above double backslash tells shell your realiasing an internal
    	command with the same name (prevents, alias loop error).
    
->    
->    2.  I have problems sometimes when I try to use an amigados command.
->        For example:  search *.h text
->                      search #?.h text      <---  Works from CLI
->        these both come back with "bad command arguments".
->

	Shell expands all wild cards '?' and '*' to file names before
	calling the command to run (internal or external).
	since search only expects one file spec *.h will resolve into
	maybe many files and be sent to search as: search a.h b.h c.h ect...
	This would fail even from a CLI.
	In reality search should be smarted enough as some amigados commands
	are to accept more than one argument, but it's not.
	The solution is :
		$ search "#?.h" text
	or      $ searcg #\?.h text

	both cause the shell interpreter to ignore the wild card and pass
	it to the command.

->    3.  I would like to delete some of the amigados commands which shell
->        provides inherently, but I have one problem.  If I want to do
->        something in the background (e.g. print a file), I might enter
->    
->        $ run type textfile prt:
->    
->        Obviously, if I delete the type command from c: this will fail.
->        What I would like to do is something like the following:
->    
->        $ run shell "type textfile prt: ; quit"
->    
->        I'm probably missing something important...
->    
	Yes, your missing the -c switch to shell. That does exactly what
	you want.
		
	eg.
           $ run shell -c type textfile >prt:

	or $ run shell -c copy textfile prt:

	or $ run shell -c copy textfile prt:; another cmd; another cmd ect..

->    regards,
->    
->    steve mcafee

	Gee.. not bad, three for three. :-)

	Steve.
    
521.5ANGORA::SMCAFEESteve McAfeeThu Jun 11 1987 03:007
    
    Thanks,
    
    I don't know how I missed that -c switch.  I can't wait to bash
    away at all those c: commands on my lattice disk...
    
    steve mcafee
521.6ALIAS- where is it???RSTS32::HUNTWherever you go, there you are!Thu Jun 11 1987 14:5210
    Hello,
    
    This is kind of off the subject, but it was mentioned in .4 above.
    
    Where can I get a copy of the ALIAS command.  It doesn't seem to
    be on my disks anywhere.
    
    
    Phil Hunt
    
521.7PLDVAX::SMCAFEESteve McAfeeFri Jun 12 1987 00:3315
    
    Alias is a command which is available when one is inside Steve-n-Matt's
    shell.
    
    re. .3
    
    Something wierd happens when I use set _prompt ^[[33m$" "^[[0m .
    It works fine as far as getting the prompt the way I want it, but
    now try to do a couple of up-arrows or down-arrows.  The cursor
    moves up the screen!  I tried other escape sequences and got the
    same results.  What's going on?
    
    regards,
    
    steve mcafee
521.8Oh, YeahCGOU01::DREWSteve DrewFri Jun 12 1987 03:0714
    
    Now I remember, putting non printable charactercs into the prompt
    string causes the command line editing to become confused as to
    how many characters have been put to the screen (including _prompt).
    
    This will be a bit of work to fix. Since not many people have 
    complained about this restriction (one other about 6 months ago)
    I never got around to fixing it.
    If I can think of an easy way to do it, I will and let you know.
  
    If conman ever beomes solid, eg: doesnt keep crashing if you hold
    down a key and wrap arround to next line stops missing a character
    ect... then I could take command line editing out of shell all
    together.
521.9SQM::JMSYNGEJames M Synge, VMS Performance Anal.Fri Jun 12 1987 16:566
Re: .-1
	In what way do non-printable characters cause a problem?  Couldn't
	you simply print the prompt then ask CON: for the current position?

James Synge
521.10Not quite that easyCGOU01::DREWSteve DrewSun Jun 14 1987 20:1515
    Re: .9
    
    Agreed that is the way to fix that problem, however it's not quite
    as easy as sending an escape sequence and waiting for the cursor
    position report back. The reason being is that the user may already
    have typed ahead some characters, when I then wait for the cursor
    report I end up getting these first.
    So to properly do this I have to handle the cursor report
    asynchronously in other words, send the request, then imediately
    start inputing any characters from the user, if a <CSI> sequence
    comes flying in, during this stuff I have to detect and handle it.
    This is also the way I was handling the window resizing. So I can
    fix it, it's just a little tricky.
    
    Steve
521.11Quick question?COOKIE::WECKERDave (Cum Grano Salis) WeckerMon Jun 15 1987 02:4419
Steve here's what appears to be a bug (been there forever):

If you say something like:

	set scr ""
	if $scr
		run foo
		endif

	if $scr
		df0:c/run foo
		endif

The first "if" will ALWAYS execute no matter what "scr" is set to. The second
one will execute only if "scr" is not "".

Any ideas?
dave