🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.shell
13 messages
13 total messages Started by Paul Lindner Wed, 19 Sep 1990 20:38
Background writes in csh
#1181
Author: Paul Lindner
Date: Wed, 19 Sep 1990 20:38
19 lines
1107 bytes
I've been having a weird problem for the longest time.  I like to use`
aliases for my ls command:

   alias ls 'ls -FC \!* |more'

This works fine, however sometimes it stops both tasks and puts them in 
the background, (this is on various Suns using csh and tcsh).  Typing
fg restarts the listing.  This is really irritating, typing fg and all.

I've also had this problem on the IBM RS/6000.  Except in this case
typing fg just hangs the shell.

Any solutions would be greatly appreciated.

-- 
---------------------------------------------------------------------
Paul Lindner 			 	| Microcomputer & Workstation
Asst. Sun System Administrator	 	| Networks Center
lindner@boombox.micro.umn.edu		||||| | | | |  |  |  |   |   
Re: Background writes in csh
#1195
Author: Gordon C. Galligher
Date: Thu, 20 Sep 1990 18:51
25 lines
1756 bytes
In article <1990Sep19.203803.25798@cs.umn.edu> lindner@cs.umn.edu (Paul Lindner) writes:
>I've been having a weird problem for the longest time.  I like to use`
>aliases for my ls command:
>
>   alias ls 'ls -FC \!* |more'
>
>This works fine, however sometimes it stops both tasks and puts them in 
>the background, (this is on various Suns using csh and tcsh).  Typing
>fg restarts the listing.  This is really irritating, typing fg and all.

More(1) is the problem here.  I have not quite figured it out, but I had a 
similar problem when my users would type:  history | more and it would do
the same thing.  When they use history | less  it works every time.  I
really hate it when people come on and say "use this tool instead" but in
this instance, it really is the only way I was able to work around the
problem.  It is immaterial that less is better than more (IMHO), in this 
instance it makes things work.

		-- Gordon.
-- 
Gordon C. Galligher	9127 Potter Rd. #2E	Des. Plaines, Ill.    60016-4881
     telxon!ping%gorpong@uunet.uu.net (not tested)  (Is this even legal??)
     ...!uunet!telxon!ping!gorpong      (tested)    (And it works!)
"It seems to me, Golan, that the advance of civilization is nothing but an
 exercise in the limiting of privacy." - Janov Pelorat -- _Foundation's Edge_
Re: Background writes in csh
#1207
Author: Kartik Subbarao
Date: Fri, 21 Sep 1990 21:15
25 lines
1587 bytes
>More(1) is the problem here.  I have not quite figured it out, but I had a 
>similar problem when my users would type:  history | more and it would do
>the same thing.  When they use history | less  it works every time.  I
>really hate it when people come on and say "use this tool instead" but in
>this instance, it really is the only way I was able to work around the
>problem.  It is immaterial that less is better than more (IMHO), in this 
>instance it makes things work.
>
>		-- Gordon.

I've been meaning to switch over to less so many times, but only ONE thing
stopped me. It appears superior in many ways, but for one annoying 
inconvenience (IMHO). At the very end of the article, you HAVE to type q
to quit. With more, I just hit the spacebar as the last screenfull pours
over my screen and that's it. Does any body have any suggestions as to how
I can make less behave like more?

			-Kartik



(I need a new .signature -- any suggestions?)
subbarao@{phoenix or gauguin}.Princeton.EDU -|Internet
kartik@silvertone.Princeton.EDU (NeXT mail)       -|	
subbarao@pucc.Princeton.EDU		          - Bitnet
Re: Background writes in csh
#1208
Author: Joseph Wells
Date: Sat, 22 Sep 1990 02:30
29 lines
1862 bytes
In article <1990Sep20.185147.14158@ping.uucp> gorpong@ping.uucp (Gordon C. Galligher) writes:

   In article <1990Sep19.203803.25798@cs.umn.edu> (Paul Lindner) writes:
   >I've been having a weird problem for the longest time.  I like to use`
   >aliases for my ls command:
   >
   >   alias ls 'ls -FC \!* |more'
   >
   >This works fine, however sometimes it stops both tasks and puts them in 
   >the background, (this is on various Suns using csh and tcsh).  Typing
   >fg restarts the listing.  This is really irritating, typing fg and all.
   >
   >I've also had this problem on the IBM RS/6000.  Except in this case
   >typing fg just hangs the shell.

   More(1) is the problem here.  I have not quite figured it out, but I had a 
   similar problem when my users would type:  history | more and it would do
   the same thing.  When they use history | less  it works every time.

I suspect you're wrong, because there is a known problem with Sun's csh
that causes this problem with pipelines in general.  It's a race condition
during the setup of the pipeline by the csh.  I suspect that less works
because it has a larger executable file and thus takes slightly longer for
SunOS to load.

I don't know about the problem on the IBM RS/6000.

-- 
Joe Wells <jbw@bu.edu>
Re: Background writes in csh
#1240
Author: Alex Martelli
Date: Sun, 23 Sep 1990 09:12
24 lines
1741 bytes
subbarao@phoenix.Princeton.EDU (Kartik Subbarao) writes:

>I've been meaning to switch over to less so many times, but only ONE thing
>stopped me. It appears superior in many ways, but for one annoying 
>inconvenience (IMHO). At the very end of the article, you HAVE to type q
>to quit. With more, I just hit the spacebar as the last screenfull pours
>over my screen and that's it. Does any body have any suggestions as to how
>I can make less behave like more?

Read the fine manual, friend - "less" has MANY features!
Start it up with command line option -e to autoexit the SECOND time
you hit EOF, or -E to autoexit the FIRST such time; set the envir
variable LESS to any option string to make it default behavior.
Many other fancy options are provided... do look them up!

(me, i have experimented and find I like -e better than -E - one
keybounce or accidental space won't destroy your chance to go back
into the less'ed file, use an editor on it, etc - nice in pipes!).

-- 
Alex Martelli - CAD.LAB s.p.a., v. Stalingrado 45, Bologna, Italia
Email: (work:) staff@cadlab.sublink.org, (home:) alex@am.sublink.org
Phone: (work:) ++39 (51) 371099, (home:) ++39 (51) 250434; 
Fax: ++39 (51) 366964 (work only; any time of day or night).
Less (was: Re: Background writes in csh)
#1223
Author: Norman Joseph
Date: Mon, 24 Sep 1990 13:39
13 lines
1108 bytes
In <2715@idunno.Princeton.EDU> subbarao@phoenix.Princeton.EDU (Kartik Subbarao) writes:

>Does any body have any suggestions as to how
>I can make less behave like more?

Yes.  Read The Friendly Manual.  Less is fully configurable (including the
ability to quit after reaching the end of its input without having to type
a `q').
-- 
Norm Joseph - (amanue!oglvee!norm)           cgh!amanue!oglvee!norm@dsi.com, or
  Oglevee Computer Systems, Inc.             ditka!oglvee!norm@daver.bungi.com
                                   ---<*>---
      "Shucking Usenet oysters in pursuit of a pearl."  --  Bill Kennedy
Re: Background writes in csh
#1224
Author: David N. Blank
Date: Mon, 24 Sep 1990 14:57
24 lines
1542 bytes
> I've been meaning to switch over to less so many times, but only ONE
> thing stopped me. It appears superior in many ways, but for one
> annoying inconvenience (IMHO). At the very end of the article, you
> HAVE to type q to quit. With more, I just hit the spacebar as the last
> screenfull pours over my screen and that's it. Does any body have any
> suggestions as to how I can make less behave like more?

Well, from Mr. Manpage:

: OPTIONS
: ...
:      -e   Normally the only way to exit less is via the "q" com-
:           mand.  The -e option tells less to automatically exit
:          the second time it reaches end-of-file.
:
:     -E   The -E flag causes less to exit the first time it
:          reaches end-of-file.

You can also set the environment variable "LESS" to contain "-E" and
any other options which will be used every time you envoke less.
Enjoy.
                Peace,
                    dNb
Re: Background writes in csh
#1228
Author: Marc Roussel
Date: Mon, 24 Sep 1990 22:51
32 lines
2010 bytes
In article <JBW.90Sep21223022@bucsf.bu.edu> jbw@bucsf.bu.edu (Joseph Wells) 
writes:
>   In article <1990Sep19.203803.25798@cs.umn.edu> (Paul Lindner) writes:
>   >I've been having a weird problem for the longest time.  I like to use`
>   >aliases for my ls command:
>   >
>   >   alias ls 'ls -FC \!* |more'
>   >
>   >This works fine, however sometimes it stops both tasks and puts them in 
>   >the background, (this is on various Suns using csh and tcsh).  Typing
>   >fg restarts the listing.  This is really irritating, typing fg and all.
>
>[...] there is a known problem with Sun's csh
>that causes this problem with pipelines in general.  It's a race condition
>during the setup of the pipeline by the csh.  I suspect that less works
>because it has a larger executable file and thus takes slightly longer for
>SunOS to load.

If this is indeed the case, we have a similar (though slightly
different) problem on our Apollo's.  (Processes which start and execute
too fast sometimes terminate before the pipe is open.  This results in
no output when there should have been.)  Anyway, try 

alias ls '(ls -FC \!* | more)'

On our machines, running the whole thing in a subshell slows the process
start up enough to allow the pipe to open in a timely fashion.

                                No guarantees... just a thought.

				Marc R. Roussel
                                mroussel@alchemy.chem.utoronto.ca
Re: Background writes in csh
#1239
Author: Paul Lindner
Date: Tue, 25 Sep 1990 22:59
24 lines
1364 bytes
gorpong@ping.uucp (Gordon C. Galligher) writes:

>>   alias ls 'ls -FC \!* |more'
>>
>>This works fine, however sometimes it stops both tasks and puts them in 
>>the background, (this is on various Suns using csh and tcsh).  Typing
>>fg restarts the listing.  This is really irritating, typing fg and all.

>More(1) is the problem here.  I have not quite figured it out, but I had a 
>similar problem when my users would type:  history | more and it would do
>[.........]

More(1) isn't the problem here, I tried using less for a while but I still
got the infamous:

Stopped (tty output)
[1] 21298 21299

So, it must be someplace in the shell.
-- 
---------------------------------------------------------------------
Paul Lindner 			 	| Microcomputer & Workstation
Asst. Sun System Administrator	 	| Networks Center
lindner@boombox.micro.umn.edu		||||| | | | |  |  |  |   |   
Re: Background writes in csh
#1245
Author: Paul Lindner
Date: Wed, 26 Sep 1990 21:35
19 lines
1203 bytes
>Stopped (tty output)
>[1] 21298 21299

>So, it must be someplace in the shell.

Yes there is an answer and a solution, our friend the stty command:

     [-]tostop   Stop background jobs that attempt  to  write  to
                 the terminal.  With a `-', allow background jobs
                 to write to the terminal.

Thanks go to Jay Lessert for the solution to this problem.


-- 
---------------------------------------------------------------------
Paul Lindner 			 	| Microcomputer & Workstation
Asst. Sun System Administrator	 	| Networks Center
lindner@boombox.micro.umn.edu		||||| | | | |  |  |  |   |   
Re: Less (was: Re: Background writes in csh)
#1266
Author: Bob Peirce #305
Date: Thu, 27 Sep 1990 12:04
16 lines
1235 bytes
In article <603@oglvee.UUCP> norm@oglvee.UUCP (Norman Joseph) writes:
>In <2715@idunno.Princeton.EDU> subbarao@phoenix.Princeton.EDU (Kartik Subbarao) writes:
>
>>Does any body have any suggestions as to how
>>I can make less behave like more?
>
>Yes.  Read The Friendly Manual.  Less is fully configurable (including the
>ability to quit after reaching the end of its input without having to type
>a `q').

I use the following alias for more.  It seems to be pretty close.

	less -eMb20PM\<--More--\>P$
-- 
Bob Peirce, Pittsburgh, PA				  412-471-5320
...!uunet!pitt!investor!rbp			rbp@investor.pgh.pa.us
Re: Background writes in csh
#1309
Author: Esa K Viitala
Date: Tue, 02 Oct 1990 11:31
42 lines
2574 bytes
In article <90Oct1195212*Harald.Eikrem@elab-runit.sintef.no> Harald.Eikrem@elab-runit.sintef.no writes:
  >Joe Wells <jbw@bu.edu> responding to Gordon C. Galligher <gorpong@ping.uucp>:
  >================
  >   >
  >   >   alias ls 'ls -FC \!* |more'
  >   >
  >   >This works fine, however sometimes it stops both tasks and puts them in 
  >   >the background, (this is on various Suns using csh and tcsh).  Typing
  >   >fg restarts the listing.  This is really irritating, typing fg and all.
  >   >
  >   More(1) is the problem here.  I have not quite figured it out, but I had a 
  >I suspect you're wrong, because there is a known problem with Sun's csh
  >that causes this problem with pipelines in general.  It's a race condition
  >during the setup of the pipeline by the csh.  I suspect that less works
  >because it has a larger executable file and thus takes slightly longer for
  >SunOS to load.
  >
  >I dont know.  I experience this problem somewhat different on a Sun Sparc
  >490 with os 4.0.3.  I always use tcsh 5.12, btw.  I think in nearly half
  >the cases I pipe something into less, less hangs indefinitely and I have to
  >suspend it with a ^Z and then fg.  Nothing whatsoever gets written to my tty
  >What is going on?
  >
  >--Harald E

Same thing on my SPARCstation 1 & Sun 3/80, it has been going for some
time now. I thought it was our "Cable Guys" causing problems on my LAN,
because they've been doing some installing. A closer look into it
reveals that I experience the same pipeline trouble as others.

Sometimes the i/o gets going in a while (in a few seconds) but it happens
I have to use ^Z + fg, too.

      On the Sparcstation I run: SunOS Release 4.0.3c,
      on Sun 3/80: SunOS Release 4.0.3_EXPORT

Any cure for this available?

-- 
Esa Viitala
TOLLPOST-GLOBE A/S, Systemavdeling, PO Box 100, N6301 ]ndalsnes, Norway
Tel: (+47 72) 21211 / 264, Fax: (+47 72) 22161 ...!mcsun!nuug!tglobe2!esa
Re: Background writes in csh
#1411
Author: Joe Wells
Date: Sun, 07 Oct 1990 06:18
33 lines
1850 bytes
lindner@cs.umn.edu (Paul Lindner) writes:

   gorpong@ping.uucp (Gordon C. Galligher) writes:

   >>   alias ls 'ls -FC \!* |more'
   >>
   >>This works fine, however sometimes it stops both tasks and puts them in 
   >>the background, (this is on various Suns using csh and tcsh).  Typing
   >>fg restarts the listing.  This is really irritating, typing fg and all.

   >More(1) is the problem here.  I have not quite figured it out, but I had a 
   >similar problem when my users would type:  history | more and it would do
   >[.........]

   More(1) isn't the problem here, I tried using less for a while but I still
   got the infamous:

   Stopped (tty output)
   [1] 21298 21299

   So, it must be someplace in the shell.

I finally remembered the problem:  Sun's (and other vendor's) csh is based
on an early BSD csh that depended on the original semantics of vfork.
However, Sun made vfork behave the same as fork, hence it is no longer
certain that the first child the csh forks in a pipeline executes setpgrp
before the csh changes the pgrp of the tty device.

I can't remember if Sun ever fixed this one, but it's been around for
several years.

-- 
Joe Wells <jbw@bu.edu>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads