HDTenEightyP/NetNews huggingface dataset:
From: eca@lsil.com (Eric c. Anderson)
Newsgroups: comp.unix.shell
Subject: How do you change modes in Tcsh?
Keywords: tcsh help
Date: 14 Apr 92 18:08:33 GMT
Reply-To: eca@lsil.com
Organization: LSI Logic Corporation

I'm trying out Tcsh for the first time. I've read the man page and still
haven't figured out how to toggle between insert and overwrite mode. I
typically use vi and it is set as my default editor. I assume that I just
hit [esc] and modes would toggle.

Could someone please direct me to a FAQ on tcsh or explain how to toggle
input modes.


---


   Eric C. Anderson                                             +-----+
   LSI Logic Corporation      phone    : (408) 954-4915      LSI|LOGIC|
   1501 McCarthy Blvd.        FAX      : (408) 433-6802         |     |
   M/S E-192                  email    : eca@eroica             +-----+
   Milpitas, Ca.  95035       internet : eca@lsil.com

-------------------------------------------------------------------------
From: zubin@dworkin.wustl.edu (Zubin Dittia)
Newsgroups: comp.unix.shell
Subject: Re: How does one compare strings in zsh?
Date: 5 Apr 92 11:51:34 GMT
Organization: Washington University,  St Louis MO

In my original posting, I had claimed that the following sequence didn't
work for me:
	TESTSTRING="test string"
	if ( [[ $TESTSTRING = "test string" ]] ) {
		echo 'it works'
	} else {
		echo 'it does not work'
	}
I received a number of replies saying that this worked fine for others,
so I went back and recompiled zsh. Surprisingly, it worked fine that time.
The only difference between the two compiles was that I had used 
"gcc -traditional" the first time, and "cc" the second. Apparently, zsh 
misbehaves when compiled with gcc. Since I don't know the technical
differences between the two compilers (I normally prefer using gcc),
I can't speculate on the possible cause for this.

-Zubin.
From: yoongc@syma.sussex.ac.uk (Yoong Hon Chong)
Newsgroups: comp.unix.shell
Subject: Re: 2 quick questions...
Date: 15 Apr 92 11:41:52 GMT
Organization: University of Sussex

In article <73939@netnews.upenn.edu>, gasser@eniac.seas.upenn.edu (Nathan Gasser ><>  ) writes:
> Hi all,
> 
> 1) Why the heck won't this work:
> 
> alias zmore 'zcat $1 | more'
> 
> It used to, I belive, but won't anymore.
> 

Try:
	alias zmore 'zcat \!* | more'

I had tried it out and it worked. I am on SunOS 4.1.2, tcsh-6.01.11 (Cornell).

Chris

-- 
===============================================================================
Chris Y H Chong - Comp.Sc. 		Internet: yoongc@central.susx.ac.uk
University Of Sussex				  yoongc@cogs.susx.ac.uk
United Kingdom					  yoongc@syma.susx.ac.uk
From: nt@otter.hpl.hp.com (Nicolas Tripon)
Date: Thu, 9 Apr 1992 17:16:17 GMT
Subject: Re: Question on sed/shell programming
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Newsgroups: comp.unix.shell

uncomment :
sed 's/\/\*.*\*\///
     s/\/\*/\
\/\*/
     s/\*\//\*\/\
/' "$@" |
sed '/\/\*/,/\*\//d
     /^[ 	]*$/d'

  Above, [ 	] contains a space and a tab. uncomment [file]
Newsgroups: comp.unix.shell
From: marc@r-node.gts.org (Marc Fournier - System Admin)
Subject: help with csh
Organization: R-node Public Access UNIX System (416-636-2026) - 24hrs.
Date: Sun, 05 Apr 1992 18:33:59 GMT

Hi...

	Simple problem that I can't seem to find an answer to :(

	I just started using csh and am using default .cshrc and .login
files that someone on my system created, and they work great.  The 
problems is that '*' no longer seems to work as a wildcard.

	Any ideas?

Thanks...

Marc

-- 
**********************************************************************
|     Marc Fournier    R-Node Public Access Unix    416-636-2026     |
|     1700+ newsgroups      network email      files       24hrs     |
|                    news and mail feeds available                   | 
|     marc@r-node.gts.org      r-node!marc      marc@r-node.uucp     |
**********************************************************************
From: kolks@imec.be (Tilman Kolks)
Newsgroups: comp.unix.shell
Subject: Which Shell to Use ?
Keywords: shell tcsh ksh csh
Date: 9 Apr 92 14:13:11 GMT
Organization: IMEC vzw, 3030 Leuven, Belgium

Hi everybody,

I am planning to use another shell than the Csh I am using right
now on my apollo.
I have as options:
	- Tcsh (version 6.01.00)
	- Ksh.

What I like about the Tcsh:
- command line completion
- fast ls-F
- Emacs-like command editing.

The Ksh offers me (as far as I know)
- Emacs-like command editing.

Questions:
Is that everything I can get out of Ksh ?
(so the Tcsh is superiour ?)
Are there other shell-types of which I am not aware of, and
are worth knowing about ??

The point is that the although the Tcsh is good, it
is NOT supported in my (Apollo) environment. When things get rough,
I am all alone (sniff). The compilation of the Tcsh resulted in 
a compilation error (fixed through the use of violance)
and a whole lot of warnings, so I am not so sure of the result.
In the end, I, of course, prefere a supported executable IFF it can offer
me something as command-line completion etc.

I hope somebody out there can give me some info ...

Post it, or send a mail to : kolks@imec.be

Thanks.

Tilman Kolks
at IMEC,
   Kapeldreef 75
   3001, Leuven.
   Belgium.
   Email: kolks@imec.be
From: hsc@stroid.sybase.com (Howard Cohen)
Newsgroups: comp.unix.shell
Subject: Problems with sh on Multrix
Date: 6 Apr 92 16:18:30 GMT
Organization: Sybase, Inc.

A few weeks ago, I posted a request for information concerning the Multrix
Bourne shell.  I was bemoaning the lack of the "unset" command.  A few
kind people out there replied with the crucial answer:

	Use "/bin/sh5" instead of "/bin/sh"

Apparently, /bin/sh is a very old Bourne shell, and /bin/sh5 is a much newer,
System V compliant version.  This provides at least a means by which my
tools may run on Multrix.  I realy want to thank those listed below for
their informative replies.  I am again in awe of the power of information and
the kindness of strangers.

Thanks to:
	Byron Rakitzis 	<byron@archone.tamu.edu>
	Steve Baur 	<baur@MDCBBS.COM>
	Peter McLain 	<pbm@hpfclj.fc.hp.com>

  Howard

-------------------------------------------------------------------------------
  Howard "I wood if I could" Cohen
  hsc@sybase.com  {pacbell,pyramid,sun,{uunet,ucbvax}!mtxinu}!sybase!hsc
  Sybase, Inc.    6475 Christie Avenue, Emeryville, CA 94608, 510-596-3406 
Newsgroups: comp.unix.shell
From: brandy@tramp.Colorado.EDU (BRANDAUER CARL M)
Subject: Re: sed - use with multiple files
Organization: University of Colorado, Boulder
Date: Thu, 9 Apr 1992 01:29:43 GMT

rouben@math9.math.umbc.edu (Rouben Rostamian) writes:

>In article <1992Apr8.022554.8516@unixland.natick.ma.us> trw@unixland.natick.ma.us (Tim Weil) writes:
>>I'm looking for a way to use sed with an editor (vi would be fine)
>>to make global changes to a set of files in a subdirectory. 
>>Can this be done with shell programming?

>This can be done in most shells.  The particular sequence of commands
>depends on the shell.   With sh you can do:

>for filename in *
>do
>[your sed command here applied to the file $filename]
>done


>In csh you can do:

>foreach filename in (*)
>[your sed command here applied to the file $filename]
>end

>You may substitute other wildcards in place of * as appropriate.

I am afraid that these suggestions will do nothing more than either:

1. Leave all the files unchanged unless 'w' is the last command in the
   sed script.

or

2. Destroy all of the files if 'w' is in the command list (remember, 'sed'
   reads the input one line at a time and performs all editing commands 
   everytime).

The simplest solution is to use none other than our old friend 'ed'.

	for i in *
	do
	ed $i <<'!'
	list of editing commands
	w
	done

Ed will quit when it receives EOF, so 'q' is not needed.

Newsgroups: comp.unix.shell
From: navarra@casbah.acns.nwu.edu (John Navarra)
Subject: Re: Why doesn't this work (sh) and what's the (t)csh version?
Organization: Northwestern University, Evanston, Illinois
Date: Fri, 17 Apr 1992 03:28:59 GMT

In article <RATINOX.92Apr16221014@splinter.coe.northeastern.edu> ratinox@meceng.coe.northeastern.edu writes:
>>>>>> On 16 Apr 92 04:47:08 GMT, def2@engr.uark.edu (Don Faulkner) said:
>
>
>Ok. There are two possibilites 1) screen has a detached process you wish
>to reconnect to, 2) no screen process running. In C-Shell:

	Actually, there are 3 possibilities I can think of right now:
1) screen is not running 2) screen has a detached process 3) screen
has an attached process that you somehow got disconnected from.

just testing for 1 and 2 will not always work. 3 happens to me sometimes
when my modem line gets disconnected, computer screws up and I need to
reboot, etc.

My rough idea (which I have not tested yet) is the following:
> 
sh:
	noresponse=`screen -r | grep No`
	if ($noresponse)	#screen is not running
		screen
        fi
	attached=`screen -r | grep Attached`
	if ($attached)		# there is already an attached screen
		# do some correcting for that
		pid=`ps | grep screen | 'something to get pid field'`
		kill -HUP $pid
		screen -r
        else 	
	    # there is a detached screen to connect to
	    screen -r	
	fi

That is the basic idea and you can transform it to yucky csh or whatever
you wish.

-tms

-- 
From the Lab of the MaD ScIenTiST:
					
navarra@casbah.acns.nwu.edu		
Xref: sparky comp.unix.shell:1985 comp.unix.questions:5899 comp.unix.misc:1964
From: jlim@silver.cs.umanitoba.ca (Tung Tseung Johnny Lim)
Newsgroups: comp.unix.shell,comp.unix.questions,comp.unix.misc
Subject: How to save specific header line with 'rn' ?
Date: 6 Apr 92 21:33:56 GMT
Organization: Computer Science, University of Manitoba, Winnipeg, Canada

Hello,

(Sorry if this is not the right group to post this message)

I am new to the 'rn' program and find it very interesting.  I have checked
the manual for 'rn' (man rn) and could not solve my problem.
I would like to be able to save some news without including all the
header lines (i.e. just to include: Date, From and Subject).

I know that I can just type in: s in 'rn' to save an article or a range of 
articles, but I don't know how I can "customize" 'rn' to omit other header
lines when saving.

I would appreciate if someone can tell me how to customize 'rn' or
use specific combination of interpolation (or a script file) to only save 
specific header lines.

Thank you for your time.

Johnny Lim
Newsgroups: comp.unix.shell
From: rouben@math9.math.umbc.edu (Rouben Rostamian)
Subject: Re: sed - use with multiple files
Organization: University of Maryland Baltimore Campus, Academic Computing Services
Date: Wed, 8 Apr 1992 03:05:16 GMT

In article <1992Apr8.022554.8516@unixland.natick.ma.us> trw@unixland.natick.ma.us (Tim Weil) writes:
>I'm looking for a way to use sed with an editor (vi would be fine)
>to make global changes to a set of files in a subdirectory. 
>Can this be done with shell programming?

This can be done in most shells.  The particular sequence of commands
depends on the shell.   With sh you can do:

for filename in *
do
[your sed command here applied to the file $filename]
done


In csh you can do:

foreach filename in (*)
[your sed command here applied to the file $filename]
end

You may substitute other wildcards in place of * as appropriate.

--
Newsgroups: comp.unix.shell
From: jik@athena.mit.edu (Jonathan I. Kamens)
Subject: egrep -v (was HELP)
Organization: Massachusetts Institute of Technology
Date: Thu, 9 Apr 1992 21:29:28 GMT

First of all, in the future, when posting a question to the USENET,
please try to use Subject lines that are a bit more descriptive than
"HELP".

In article <854@wcsn.csms.com> ken@wcsn.csms.com (Kenneth D. Fox WCSN Sr. Operations Engineer) writes:

   This is what I need to do? 

   I have a file named Day.open
   I would like to remove all lines that DO NOT contain
   the following words XMISN XMITR COAX

What do you mean by "remove?"  Do you mean that you want to produce a
new file with those lines not in it, or that you want to edit the
Day.open file in place?

   The below script does the opposite by removing all lines 
   containing XMISN XMITR COAX

Actually, it's not at all clear to me what "the below script" does, or
what you intend for it to do.  Here's a line-by-line analysis of your
script:

   : 
   #
   # place all lines with XMITR XMISN COAX in file open
   cd /u/work.order/tmp
   grep  'XMITR | XMISN | COAX' Day.open > open

Well, the first problem here is that on most UNIX systems, the "grep"
command does not allow the use of "|" to indicate alternative regular
expressions.  The result is that grep is going to look for the string
"XMITR | XMISN | COAX" in the file Day.open, and output all of the
matches it finds.  Since it probably won't find any, at this point,
the file "open" will be empty.

   #need to remove all lines in file /u/work.order/tmp/Day.open
   # with XMITR XMISN & COAX in them
   egrep -v ' COAX | XMISN | XMITR ' Day.open > open.2

Are the words COAX, XMISN and XMITR in your file always surrounded on
both sides by spaces?  If so, then this command is fine, and the
contents of open.2 after it runs should be all of the lines that do
not contain the three listed strings.  However, if not, then you
should delete the spaces in your regular expression, and use

	egrep -v 'COAX|XMISN|XMITR' Day.open > open.2

This seems to work just fine to me, so I don't understand completely
why you're having trouble:

% cd /tmp/work.order
% cat Day.open
1 foo
2 bar
3 baz
4 XMITR
5 frelt
6 screeble
7 XMISN
8 qux
9 COAX
10 quux
% egrep -v 'COAX|XMISN|XMITR' Day.open
1 foo
2 bar
3 baz
5 frelt
6 screeble
8 qux
10 quux
% 

-- 
Jonathan Kamens						jik@MIT.Edu
MIT Information Systems/Athena		    Moderator, news.answers
    (Send correspondence related to the news.answers newsgroup
	{and ONLY correspondence related to the newsgroup}
		 to news-answers-request@MIT.Edu.)
Newsgroups: comp.unix.shell
From: trw@unixland.natick.ma.us (Tim Weil)
Subject: sed - use with multiple files
Organization: Unixland Public Access Unix  (508) 655-3848
Date: Wed, 8 Apr 1992 02:25:54 GMT

I'm looking for a way to use sed with an editor (vi would be fine)
to make global changes to a set of files in a subdirectory.  The
use of sed isn't mandatory but the concept is to 
      Open File
      Make Global Change (sed or no sed)
      Close File
      Repeat for all files in directory
 
Can this be done with shell programming?  Any advice much appreciated.
 
Timothy.Weil@dialcom.tymnet.com
 

Newsgroups: comp.unix.shell
From: alec@k2.stortek.com (Alec Sharp - x2955)
Subject: shelltool and xterm windows
Organization: Storage Technology Corp.
Distribution: na
Date: Mon, 13 Apr 1992 16:15:19 GMT

I am using both xterm and shelltool windows on my workstation.  I print
the current working directory in the banner at the top of the window.

Is there an easy way to tell which window I'm in so that my shell can
figure out which escape sequence to print?

Alec Sharp
alec@stortek.com
From: jik@athena.mit.edu (Jonathan I. Kamens)
Newsgroups: comp.unix.shell
Subject: Re: How to get TAB into the cmd line in tcsh
Date: 7 Apr 92 15:32:23 GMT
Organization: Massachusetts Institute of Technology

In article <1992Apr7.004548.14654@csc.canberra.edu.au> Kim Holburn writes:

   From: Kim Holburn

Please fix your news software to put a valid From line in your
outgoing messages.  For example:

	From: kim@csc.canberra.edu.au (Kim Holburn)
	From: Kim Holburn <kim@csc.canberra.edu.au>

   I need to get a literal  TAB into the command line in tcsh. As in:
   grep ^[ #\t] /etc/printcap
   only the \t doesn't work of course! and tcsh won't let me put in an actual TAB.

Yes, it will.  Type ^V before you type the TAB.

-- 
Jonathan Kamens						jik@MIT.Edu
MIT Information Systems/Athena		    Moderator, news.answers
    (Send correspondence related to the news.answers newsgroup
	{and ONLY correspondence related to the newsgroup}
		 to news-answers-request@MIT.Edu.)
Newsgroups: comp.unix.shell
From: s4uhkm@almserv.uucp (Howie Michalski)
Subject: (N)awk script needed to parse crontab.
Organization: Fannie Mae
Date: Wed, 8 Apr 1992 18:48:44 GMT

Hi gang,

A couple of us here are working on a script (nawk) that will monitor processes that
are scheduled, running, late, etc...

We have most of the logic down... however we have struck upon what may be an 
insurmountable obstacle:

Our "config" file is modeled after the cron file format.. what we need to do is:

Given a range of n Hours, evaluate a crontab file to determine the runtimes of all
enetered jobs.  This MUST include wildcards (*), lists (1,2,3), and ranges (1-5).
The tricky part is not to forget that your n hour window may overlap two different
dates, days of weeks, and even months!

To establish the "window" two variables will be known StartDateTime (now)  and 
EndDateTime (now+n).  The desired output would be something like:

((These values can be loaded into variables!))
0930, Mon 17 Feb -- Job1
1030, Mon 17 Feb -- Job1
1130, Mon 17 Feb -- Job1
1230, Mon 17 Feb -- Job1

For a crontab entry like:  30 9-12 17 * Feb /usr/local/Job1

Any ideas --- Even about the LOGIC! if not code -- would be a great help

Thanks, and Happy Computing,
Howie

-- 
#include <std_disclaimer.h> /***************************************  
#define  OPINIONS my_own     * Howard K Michalski, s4uhkm@fnma.COM *
                             * Fannie Mae      Washington, DC, USA *
main(){for(;;);}             ***************************************/
From: leisner@johnker.henr801@xerox.com (Marty Leisner x76704 siena)
Newsgroups: comp.unix.shell
Subject: Re: Maintaining .cshrc files across several machines
Date: 9 Apr 92 00:55:24 GMT
Article-I.D.: spectrum.1992Apr9.005524.10364
Organization: Xerox

In article <rantapaa.702769062@s6.math.umn.edu> rantapaa@s6.math.umn.edu (Erik E. Rantapaa) writes:
>Has any one solved the problem of maintaining .cshrc files across
>several machines?  In particular, it would be nice to have a
>'cshrc-config' program which would sniff out a system for binary
>paths, libraries, etc.
>

First, I think it is a mistake to put environment variables in the .cshrc file.

Much better to put them in the .login file, so they are executed once.

Second, instead of multiple files, have one file for all machines with the
appropriate if conditionals in the script...


marty
leisner.henr801c@xerox.com
Member of the League for Programming Freedom
(You get what you pay for -- except in software)
Newsgroups: comp.unix.shell
From: jamwil@auto-trol.com (James Wilmsen)
Subject: How to set meta key for tcsh
Organization: Auto-trol Technology Corporation -- Denver, Colorado
Date: Tue, 7 Apr 1992 22:13:40 GMT

I would like to define the meta key to replace esc key for tcsh
commands, as in emacs.  I have a sun sparc style keyboard and would
like to define the diamond marked key between the space and alt as the
meta key for emacs style editing.  I am not sure if I need to use some
stty command or need to set to a particular terminal emulation.  Any
help would be appreciated.

Jim

jamwil@jamwil.auto-trol.com
-- 
------Any resemblance to the views of Auto-trol is purely coincidental-----
Don't Reply - Send mail: jamwil%auto-trol@sunpeaks.central.sun.com
Jim Wilmsen          Auto-trol Technology Corporation
(303) 252-2049       12500 North Washington Street, Denver, CO 80241-2404
From: gwilliam@crc.ac.uk (Gary Williams x3294)
Newsgroups: comp.unix.shell
Subject: appending a single quote
Date: 9 Apr 92 12:22:21 GMT
Organization: MRC Human Genome Resource Centre


I'm having trouble using sed to append a single quote ' to the end of a
line. 

The actual problem I'm trying to solve is to create a file containg csh
alias commands that can later be sourced to set up the current aliases
again.  The command should look something like this (commented for
readability):

alias | sed -e 's/\!/\\\!/g' \		# change all ! to \!
	    -e 's/^/&alias /' \		# stick 'alias ' in front of the line
	    -e "s/  /       \'/1" \	# change the first <TAB> to <TAB>'
	    -e "s/$/\'/" \	# append a ' (** THIS DOESN'T WORK **)
> file

This is intended to change a line produced by 'alias' like:

cmd	do things !*

into:

alias cmd	'do things \!*'

It is obvious why the offending sed command doesn't work - but can
anyone see a way to work around the problem?

-- 
GARY WILLIAMS,  Computing Services Section,  Janet:       G.Williams@UK.AC.CRC
MRC-CRC & Human Genome Mapping Centre,       Internet:    G.Williams@CRC.AC.UK
Watford Rd, HARROW, Middx, HA1 3UJ, UK
Tel 081-869 3294   Fax 081-423 1275   
Newsgroups: comp.unix.shell
From: terry@ithaca.npd.Novell.COM (Terry Lambert)
Subject: Re: Running a script with execute only permission?
Organization: Novell NPD -- Sandy, UT
Date: Mon, 13 Apr 1992 22:13:34 GMT

In article <q!xjw+g.daf@netcom.com>, daf@netcom.com (Douglas Forman) writes:
|> I have a script that I want other users to execute, but I don't
|> want them to be able to read it.
...
|> Is there way to make a KornShell script run that can be
|> run by other users, without giving read privalege to that
|> user?  

Yes and No.  There is no way to make the script itself unreadable but executable;
since shell scripts are interpreted, and not compiled, you MUST have read permission
to run them.

If you don't mind the shell script being run by and ID other than the user, you can run a C
program to run a shell script that the user can't see by making the C program suid "fred"
(or some other user) and giving "fred" chmod 500 ownership of the file.

					Terry Lambert
					terry_lambert@gateway.novell.com
					terry@icarus.weber.edu
From: casper@fwi.uva.nl (Casper H.S. Dik)
Newsgroups: comp.unix.shell
Subject: Re: Maintaining .cshrc files across several machines
Date: 9 Apr 92 11:29:01 GMT
Organization: FWI, University of Amsterdam

leisner@johnker.henr801@xerox.com (Marty Leisner x76704 siena) writes:

>In article <rantapaa.702769062@s6.math.umn.edu> rantapaa@s6.math.umn.edu (Erik E. Rantapaa) writes:
>>Has any one solved the problem of maintaining .cshrc files across
>>several machines?  In particular, it would be nice to have a
>>'cshrc-config' program which would sniff out a system for binary
>>paths, libraries, etc.
>>

>First, I think it is a mistake to put environment variables in the .cshrc file.

No. In this day and age of remote non-interactive shells (rexec/rsh)
you must set at least $path in .cshrc.
You can bracket such essential environment variables
with if ($?__PathIsSet) then .. setenv __PathIsSet ... endif.

>Much better to put them in the .login file, so they are executed once.

Or never ...

>Second, instead of multiple files, have one file for all machines with the
>appropriate if conditionals in the script...

I have that. But now I have a 250 line .tcshrc. It's a good thing I
only login once a week and on fast machines.
You can try something like this:

alias xpath 'if ( -d \!^ ) set path = ( \!^ $path )'
alias apath 'if ( -d \!^ ) set path = ( $path  \!^)'

These aliases will conditionally add directries to your path.

# Put /usr/local/bin in front
xpath /usr/local/bin

# Put /usr/sbin last
apath /usr/sbin

# Put /usr/5bin last
apath /usr/5bin


Casper
-- 
						|	Casper H.S. Dik
						|	casper@fwi.uva.nl
Newsgroups: comp.unix.misc,comp.unix.sysv386,comp.sys.sun.misc