[comp.sys.atari.st] Gulam question

lansd@utgpu.UUCP (08/12/87)

     Is it possible to append to another file via redirection in Gulam?
The manual doesn't mention this anywhere and I thought it may be less than
obvious about how to go about doing it. I would just like to  do a simple
'czprint filename >> datafile' (Czprint dumps data to the standard output).

     Anyway, I found an indirect way of doing this, but it has one side
effect. First, my shell file looks like this....

foreach i { *.cz }
	czprint $i 
endfor

     This script is executed via the command line 'catalog.g > datafile'.
Althought the script works to completion, the datafile doesn't have an
end-of-file terminator in it. When I edit the file or print it out (ie, 
with LESS), the editor crashes when it gets to the end of the file!

     Is this a bug with Gulam????

JOE@rcgl1.eng.ohio-state.edu (Joe Rohde) (02/11/89)

Has anyone tried to set the variable (nrows i beleive) to set the screen
to 50 rows in high res?  when i set it, my screen clears produces the same
number of rows, allows only 3 or 4 rows at the top to be used and gradually
produces garbage at the bottom of the screen that rises to the top as
return is hit.  Am i doing something wrong/stupid? or has this never
been fully implemented?

Thanks, Joe Rohde

rohde-j@eng.ohio-state.edu

pwp@iuvax.cs.indiana.edu (Paul Purdom) (09/06/90)

In gulam the foreach command can be used to do something for each file
in a directory. The if command can be used to test whether the file is
a regular file a directory, etc. Is there some way to test what the
extension on a file is? I don't see how to do this from reading the manual,
but maybe I have overlooked something.

The following (except for syntax errors) suggests what I would like to do

foreach ...\i { * }
  if $i.arc
    arc -l $i
  ef
    echo $i
  endif
endfor

With a valid test for the arc extension, this file would produce a listing
of the contents of all arc files and the name of all other files.

(Note, it is easy to do half the job: foreach ...\i {*.arc} will get
all the arc files; the hard thing is to dget the non arc ones.)

bammi@curie.ces.cwru.edu (Jwahar R. Bammi) (09/07/90)

In article <56683@iuvax.cs.indiana.edu> pwp@iuvax.cs.indiana.edu (Paul Purdom) writes:

   a regular file a directory, etc. Is there some way to test what the
   extension on a file is? I don't see how to do this from reading the manual,
   but maybe I have overlooked something.

Not directly, but you can run an external program, and test its return
status with an 'if'. the return status of the last command is recorded in
the shell variable 'status'.
--
bang:   {any internet host}!dsrgsun.CES.CWRU.Edu!bammi	jwahar r. bammi
domain: bammi@dsrgsun.ces.CWRU.edu
GEnie:	J.Bammi

klute@heike.informatik.uni-dortmund.de (Rainer Klute) (09/07/90)

In article <56683@iuvax.cs.indiana.edu>, pwp@iuvax.cs.indiana.edu (Paul
Purdom) writes:
|> In gulam the foreach command can be used to do something for each file
|> in a directory. The if command can be used to test whether the file is
|> a regular file a directory, etc. Is there some way to test what the
|> extension on a file is?

Unfortunately the answer is "no". You don't have any kind of string
processing in Gulam.

--
  Dipl.-Inform. Rainer Klute      klute@unido.informatik.uni-dortmund.de
  Univ. Dortmund, IRB             klute@unido.uucp, klute@unido.bitnet
  Postfach 500500         |)|/    Tel.: +49 231 755-4663
D-4600 Dortmund 50        |\|\    Fax : +49 231 755-2386