HDTenEightyP/NetNews huggingface dataset:
From: dhami@cs.ubc.ca (Mandeep S Dhami)
Newsgroups: comp.unix.shell
Subject: Re: escape characters in functions..in ksh
Date: 14 Oct 1992 16:15:40 -0700
Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
Distribution: usa
NNTP-Posting-Host: valhalla.cs.ubc.ca

arun@tinton.ccur.com (Arun Kandappan) writes:
>
>        echo  '\033]1$machine:$directory'
>
>	Unfortunately the $machine:$directory does not get expanded with the
>"'" and the escape sequence does not get passed correctly with the """. Anyone
>have any ideas to do this ?
>


Try:
echo -n '\033]1'$machine:$directory   # OR
echo -n '\033]1'"$machine:$directory" # BTW, -n is added to avoid that newline
                                      # being printed.

Mandeep.
__________________________________________________________________
"I'm very brave generally," he went on in a low voice:
"only to-day I happen to have a headache."
                                      -- Lewis Carroll
__________________________________________________________________
From: fnord@panix.com (Cliff Heller)
Newsgroups: comp.unix.shell
Subject: Re: How to calculate the Date of Easter?
Date: 8 Oct 92 15:47:57 GMT
Organization: Right Bleedin' Church of Libertine Obfuscatology

In <10801@hq.hq.af.mil> snolan@postmaster@hq.af.mil (Scott D Nolan) writes:

>Weird question:

>	How do I calculate the exact date for Easter in any
>given year using normal unix tools (awk, ksh, sed, perl, etc)?

>	Many thanks in advance.

I believe Easter is defined as the first Sunday after the first full moon
after the first day of spring.  The first day of spring is fixed, but you
have to have a phases of the moon database/program running as well, then it
should be a fairly trivial matter to write the program.

-- 
    / \      Reverend fnord                 | "King Kong died for your sins!"
   /   \     fnord@panix.com                | 
  / <0> \                                   | "Don't just eat a hamburger, 
 /_______\   Church of Obfuscatology, Inc.  |  eat the HELL out of it!"
From: abledsoe@sdf.lonestar.org (Al Bledsoe)
Newsgroups: comp.unix.shell
Subject: Re: How to calculate the Date of Easter?
Date: 9 Oct 92 04:03:45 GMT
Article-I.D.: sdf.Bvu5y9.6J7
Organization: Best lil' ol' Pubnix in Texas

In article <10801@hq.hq.af.mil> snolan@marge.hq.af.mil writes:
>Weird question:
>
>	How do I calculate the exact date for Easter in any
>given year using normal unix tools (awk, ksh, sed, perl, etc)?
>
>	Many thanks in advance.
>
>Scott Nolan and Les Peters
>7th CG/DOSO
>snolan@marge.hq.af.mil
>lpeters@marge.hq.af.mil
Since Easter is not a biblical holiday there is no standard.  However
Since Easter is not a biblical celebration there is no standard.
However,  since Jesus death correlates with the Jewish passover,
the calculation of such is found in Deuteronomy.   Interestingly,
when adding three days to this festival one hardly ever comes up
with a Sunday!!!

pagan!!!!!!
Newsgroups: comp.unix.shell
From: roihar@cc4.crl.aecl.ca
Subject: need help with csh alias in .cshrc file
Organization: AECL RESEARCH
Date: Thu, 8 Oct 1992 17:08:16 GMT

Hi :
I'd like a simple TODAY alias which would list files in current
directory with today's date. Nothing fancy.
I tried this but cannot figure out how to make it understood. It works at
the cshell command level.

ls -al | awk '{print $5 $6 $8}'|grep `date|awk '{print $2$3}'`

How do I make an alias to do this??

Please reply directly to roihar@crl.aecl.ca
From: jrichter@sinix.UUCP (Juergen Richter)
Newsgroups: comp.unix.shell
Subject: trap/sh -e question
Date: 7 Oct 92 14:41:25 GMT
Organization: SNI AG Muenchen, STO XS

Can anyone explain to me according to which rules 
1. "echo $?" will be called and
2. what "echo $?" will output in the following script:

  #!/bin/sh -e
  trap 'echo $? ; exit' 0
  ...
  trap 0

I have difficulties to see the rules due to the following cases for "..." (script
is called "ttt"):

...		output				exit status if called interactively
===================================================================================
[ ]		<none>				1
-----------------------------------------------------------------------------------
( [ ] )		1				1
-----------------------------------------------------------------------------------
unknown		./ttt: unknown: not found	1
		0
-----------------------------------------------------------------------------------
( unknown )	./ttt: unknown: not found	1
		1
-----------------------------------------------------------------------------------
( [ ] ) || :	<none>				0
-----------------------------------------------------------------------------------
( [ ] ) && :	<none>				1
-----------------------------------------------------------------------------------
From: lhjensen@fish.Princeton.EDU (Leif Jensen)
Newsgroups: comp.unix.shell
Subject: Re: sed & awk different between csh and sh?
Date: 16 Oct 92 19:27:26 GMT
Organization: Princeton University
Originator: news@nimaster

In article <719237300snx@johnwuu.canb.auug.org.au> johnw@canb.auug.org.au writes:
>I am using HP-UX v8.00 and noticed that the following sed and awk statements
>fail when used in a csh script file, but work correctly in a sh script.
>
>Under csh, sed fails with Variable syntax.
>           awk fails with Unmatched ".
>
>/bin/sed -e "s/[ ]*$//" \
>	 -e "s/	/        /g" \
>	 -e "s/^$/ /" \
>	 -e "s/'/''/g" < $infile > $tmpfile
>
>
>/usr/bin/awk "BEGIN { printf(\"INPUT ROUTINE \n\");\
>	             seqno=1;\
>	            } \
>		    { printf (\"'%s',%d,'%s ',NULL\n\", name, seqno, \$0);\
>		     seqno += 1;\
>		    } \
>	      END   { printf(\"END\n\"); }" name=$routine $tmpfile > $outfile

This is actually pretty simple.  The problem with the sed command is 
the $ within double quotes.  /bin/sh, being a much more amiable shell
then /bin/csh, does not choke on this since $/ is not a legal variable
name, but /bin/csh does.  No matter what shell you use, however, it is
bad style not to quote $'s that do not reference variables.

The problem with the awk command is that /bin/sh allows double quotes to
be quoted with backslashes inside double quoted strings; /bin/csh does
not.  This is just one of the many reasons why /bin/csh is far inferior
to /bin/sh for most shell programming tasks.

Fixes are simple, but I would not recommend using them in csh scripts.

--
Leif Jensen
lhjensen@phoenix.princeton.edu
Newsgroups: comp.unix.shell
From: pdel@ADS.COM (Peter Delevoryas)
Subject: Any expect users out there?
Organization: Advanced Decision Systems, Mtn. View, CA (415)960-7300
Date: Wed, 7 Oct 1992 21:00:23 GMT

..or even novices, maybe you can help me get this to work:


The expect script:

::::::::::::::
hello.exp
::::::::::::::
#!expect -f

spawn hello_sh

expect "enter name:"

send "Fred\r"


The shell script:

::::::::::::::
hello_sh
::::::::::::::
#!/bin/sh
echo -n "enter name:"
read name
echo $name > hello.out


The command:

deimos(1295)-> hello.exp
spawn hello_sh
enter name:deimos(1296)->


Maybe it's working right, and I'm 'expecting' the wrong thing   ; >
I would think it would echo the contents of name to screen, and
create a file called hello.out containing the variable contents.
Instead it just echos 'enter name:' to screen, and doesn't seem
to be sending 'Fred\r' to the program.

Ideas?

PD

--

 login name:   L1-A                      
 In real life: Peter Delevoryas
 In any other life: a cheap imitation
Newsgroups: comp.unix.shell
From: summeral@ucsu.Colorado.EDU (SUMMERALL  ELMINA LANIER)
Subject: vt320 with tsh?
Summary: Using a terminal emulator with tsh
Organization: University of Colorado, Boulder
Date: Tue, 13 Oct 1992 18:36:17 GMT

I connect to an Ultrix host with modem software.  I generally use a vt102
emulator, but my term software can emulate a vt320, which I assume must be a
pretty powerful terminal based on the number.

My question is, can tsh (my preferred shell) deal with vt320, and if that is
a good idea, then what do I put in my .login or .cshrc file or whatever to
tell the system I'm running a 320?

Thanks in advance,

Thomas Summerall
Organization: Ministry of Education, Computer Center NETNEWS system V2.3
Date: Monday, 12 Oct 1992 15:40:43 EST
From: <F43A2001@TWNMOE10.BITNET>
Newsgroups: comp.unix.shell
Subject: batch & back ground

Hi :
      I      run jobs in RS6000 model 560/550/970 .
I submit them by batch or by back ground . But there are something def. & test
in my ~/.cshrc ( such as terminal type ) . How  can I tell system to exit when
jobs coming from batch or b.g. ?


       Thank you very much .



            e-mail             m772011@pauli.phy.ncu.edu.tw
Newsgroups: comp.unix.shell
From: tucker@bedford.progress.COM (Kyle Tucker)
Subject: Losing variable outside a while loop
Reply-To: tucker@bedford.progress.COM
Organization: Progress Software Corp.
Date: Mon, 12 Oct 1992 17:23:33 GMT

Much to my amazement, it appears that variables set within a while loop,
at least mine, are lost once outside this loop. Is this true, is this correct?
I am running SUN/OS 4.1 /bin/sh and the following script is my headache.

#!/bin/sh
LINECOUNTER=0
cat ${TMPFILE} | while read LINE
do
        LINECOUNTER=`expr ${LINECOUNTER} + 1`
    INFOLIST=no
    MATCHFOUND=no
    KEYWORD=`echo ${LINE} | awk ' { print $1 } '`
    if [ "${KEYWORD}" = "subject:" ]
    then
           SCOPE=`echo ${LINE} | awk ' { print $2 } '`
           if [ ${SCOPE} != "external" -a ${SCOPE} != "internal" ]
           then
                : do some stuff
           fi
           echo $SCOPE
    fi
    echo "Line ${LINECOUNTER}: ${LINE}"
    echo "In loop: $SCOPE"
done

echo "Outa loop: $SCOPE"

$SCOPE is being set and fully usable while in the loop. Once exited, it is
blank! From test, it appears that if the "read" is done from stdin, then
the variable is intact upon exiting the while loop (???}. Any help would be 
appreciated.

p.s. I know I can use a file to store the variable, but I hate to do it :-(.

- Kyle 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Kyle Tucker - Email Administrator  | 		Progress Software Corporation
tucker@bedford.progress.com 	   |		14 Oak Park
(617)280-4565			   |		Bedford, Mass. 01730
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Newsgroups: comp.unix.shell
From: barr@pop.psu.edu (David Barr)
Subject: Re: xrsh not executing .login - why ?
Keywords: X11 xrsh csh tcsh .login
Organization: Penn State Population Research Institute
Date: Tue, 13 Oct 92 14:05:23 GMT

In article <1992Oct13.103915.8360@news.uni-stuttgart.de> schmid@asterix.ISD.Uni-Stuttgart.DE (Georg Schmid) writes:
>I'm using xrsh (part of X11 R4 and R5 I think) to log into 
>several of our computers.
>Unfortunately xrsh doesn't execute my .login file on the
>remote hosts.

You might want to put:

XTerm*loginShell:       true

In your ../lib/X11/app-defaults/XTerm

or change xrsh to run "xterm -ls"  (login shell)

--Dave
-- 
System Administrator, Population Research Institute    barr@pop.psu.edu
Newsgroups: comp.unix.shell
From: pdel@ADS.COM (Peter Delevoryas)
Subject: Re: Any expect experts out there?
Organization: Advanced Decision Systems, Mtn. View, CA (415)960-7300
Distribution: usa
Date: Wed, 7 Oct 1992 21:28:02 GMT

Well, I just found the expect_manual, printed it out, and found my
answer:

the end of hello.exp needs:

expect eof

Sorry for the wasted post. If anyone has any other solutions, please
send ! :)

pd



In article <1992Oct7.205415.3730@ads.com> pdel@ADS.COM (Peter Delevoryas) writes:
>
>..or even novices ( which obviously I'm not, can't even get the
>simplest script to work: )
>
>
>The expect script:
>
>::::::::::::::
>hello.exp
>::::::::::::::
>#!expect -f
>
>spawn hello_sh
>
>expect "enter name:"
>
>send "Fred\r"
>
>
>The shell script:
>
>::::::::::::::
>hello_sh
>::::::::::::::
>#!/bin/sh
>echo -n "enter name:"
>read name
>echo $name > hello.out
>
>
>The command:
>
>deimos(1295)-> hello.exp
>spawn hello_sh
>enter name:deimos(1296)->
>
>
>Maybe it's working right, and I'm 'expecting' the wrong thing :)
>I would think it would echo the contents of name to screen, and
>create a file called hello.out containing the variable contents.
>Instead it just echos 'enter name:' to screen, and doesn't seem
>to be sending 'Fred\r' to the program.
>
>Ideas?
>
>PD
>
>--
>
> login name:   L1-A                      
> In real life: Peter Delevoryas
> In any other life: a cheap imitation


--

 login name:   L1-A                      
 In real life: Peter Delevoryas
 In any other life: a cheap imitation
Newsgroups: comp.unix.shell
From: nevin@apple.com (Nevin ":-]" Liber)
Subject: Re: Losing variable outside a while loop
Date: Tue, 13 Oct 1992 04:57:13 GMT
Organization: Apple Computer, Inc.
Followup-To: comp.unix.shell

In article <1992Oct12.172333.5037@progress.com>,
tucker@bedford.progress.COM (Kyle Tucker) wrote:

Change:

> cat ${TMPFILE} | while read LINE
> do
>     [...]
> done

to:
    while read LINE
    do
        [...]
    done < ${TMPFILE}

You can always replace constructs of the form:
    cat file | command
with
    command < file

This is always more efficient, since the "cat" command doesn't need to be
executed, and the right side of the pipe does not need to be executed in a
subshell.  In the above example, this also has the benefit of preserving
any shell variables set within the while loop.
___
NEVIN ":-)" LIBER, RISC Porting Specialist/Blue Meanie, Mac System Software
 email:     nevin@apple.com        paper:  Apple Computer, Inc.
 voice:     (408) 974-MIX1                 20525 Mariani Avenue, MS: 81-GC
 AppleLink: BADENOV                        Cupertino, CA 95014
Newsgroups: comp.unix.shell
From: sherwood@fenris.space.ualberta.ca (Sherwood Botsford)
Subject: Re: How to calculate the Date of Easter?
Organization: University Of Alberta, Edmonton Canada
Date: Tue, 13 Oct 1992 21:38:12 GMT

Scott D Nolan writes
> Weird question:
> 
> 	How do I calculate the exact date for Easter in any
> given year using normal unix tools (awk, ksh, sed, perl,  
etc)?
> 

Not quite what you're looking for:
I think Easter is the first Sunday after the first Monday  
after the first full moon after the equinox.

I would be tempted to do it with a table lookup.  Most  
prayer books for main line christian churches will have  
something like "Table of movable feasts" which gives the  
dates for Easter and all the other liturgical stuff  
connected with them.  Tables usually go into the next  
century.
From: lhjensen@fish.Princeton.EDU (Leif Jensen)
Newsgroups: comp.unix.shell
Subject: Re: vt320 with tsh?
Date: 13 Oct 92 22:13:32 GMT
Organization: Princeton University
Originator: news@nimaster

In article <1992Oct13.183617.2991@ucsu.Colorado.EDU> summeral@ucsu.Colorado.EDU (SUMMERALL  ELMINA LANIER) writes:
>My question is, can tsh (my preferred shell) deal with vt320, and if that is
>a good idea, then what do I put in my .login or .cshrc file or whatever to
>tell the system I'm running a 320?

Since this is the second time in a week I have sent out vt300 termcap
entries I am posting this. 

With luck your friendly local sysadmins will install termcap support
for vt300's and will know enough about terminfo to do that too, if
needed.  If you can't swing this you can make a personal termcap file
by copying the vt??? section of /etc/termcap and appending these
vt300 entries to it.  You can then check if login set TERM to vt300 in
your .login and "setenv TERMCAP 'personal_termcap'".  I think this
works on most systems.  These entries came originally from the nice folks
at e-math.ams.com.  You should check them for compatibility with your
other termcap entries.

What, by the way, is tsh?  Do you mean tcsh or am I completely out of
it?

Hope this helps,
Leif Jensen
lhjensen@phoenix.princeton.edu

db|vt300|vt300-am|dec vt300:\
	:hs:\
	:es:\
	:ts=\E[1$}\E[;H\E[K:\
	:fs=\E[0$}:\
	:ds=\E[1$}\E[;H\E[K\E[0$}:\
	:tc=vt200:
de|vt320|vt320-am|dec vt320:\
	:tc=vt300-am:
dk|vt330|vt330-am|dec vt320:\
	:tc=vt320-am:
dn|vt340|vt340-am|dec vt340:\
	:tc=vt330-am:
dq|vt400|vt400-am|vt420|vt420-am|dec vt420:\
	:rf=/usr/lib/tabset/vt100:\
	:rs=\E>\E[80$|\E[24*|\E[24t\E[?4l\E[?5l\E[?7h\E[?8h\E[1;24r\E[24;1H:\
	:tc=vt320-am:
From: kbs@ccr-p6.ccr.jussieu.fr (P7 Mail Server SysOP)
Newsgroups: comp.unix.shell
Subject: UNIX SHell for a rookie!
Date: 15 Oct 92 18:53:53 GMT
Organization: Laboratoire d'Electrochimie - Paris 7, FRANCE.

Hi everybody,

Well...I use Unix for a while but didn't get into Shell
programming yet.
Can u point me the best way to tackle that, eg. FAQs,
source examples, books (for the moment I'm penny-less
and US books here are out of price!), ftp sites...

Thanx for any answers,


-- 
=============================================================================
Laboratoire d'Electrochimie - Universite Paris 7  |Khac Binh Su
4, place Jussieu, Tour 44/45, 75005 PARIS. FRANCE |e-mail: kbs@ccr.jussieu.fr
=============================================================================
From: lwv26@cas.org (Larry W. Virden)
Newsgroups: comp.unix.shell
Subject: ksh: autoloading aliases?
Date: 12 Oct 92 15:14:56 GMT
Reply-To: lvirden@cas.org (Larry W. Virden)
Organization: Nedriv Software and Shoe Shiners, Uninc.

anyone figured out a way to use the function autoloading capability to load
aliases as well?

I have long lists of various aliases which I wish I could just stick into
the function directory and would autoload when I needed them but would
stay out of the way otherwise...
-- 
Larry W. Virden                 UUCP: osu-cis!chemabs!lvirden
Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
America Online: lvirden@aol.com
Newsgroups: comp.unix.dos-under-unix,comp.sys.ibm.pc.programmer,alt.msdos.programmer
From: mcastle@mcs213d.cs.umr.edu (Michael R Castle)
Subject: Re: Reading DOS command line options
Date: Fri, 16 Oct 1992 20:57:42 GMT
Distribution: usa
Organization: University of Missouri - Rolla

In article <1992Oct15.191855.22469@devildog.att.com> wkamm@acpy01.att.com (William Kamm (CXNIXPT1)) writes:
>
>Does anyone have a DOS equivalent to the UNIX getopt() function?  This 
>function will return, one at a time, the options and any associated
>arguments entered on the command line when the program was invoked.

I *know* I've seen getopt() somewhere, but can't remember.  I just looked 
at my list of simtel20 files, and can't find it there.  It *may* be in one
of the GNUISH archives, but couldn't find a likely looking canidate.

You could try any of the various GNU archives, and use their getopt(), I'm
sure.  getopt() should be fairly portable, and not all that large.

regards,
mrc
Newsgroups: comp.unix.dos-under-unix
From: squevill@yo_dud.NoSubdomain.NoDomain (Stephane Quevillon)
Subject: SunPC on an NCD17c
Reply-To: squevill@stam.qe.bell.ca
Organization: OD, Bell Canada
Date: Fri, 9 Oct 1992 11:20:10 GMT

Hi fellows.

I am using SunPC 3.0 on my SPARC 2 without problems.  Now I would like
to start it up on an NCD xterminal --> problems!

SunPC tells me that I am running OW2 and that I should run OW3, we all
know that I DO run OW3 since it works on the SPARC.  My suspicion is that
it needs the news server... can anybody confirm that?  Is there something
special I should be doing to run on an xterminal (X11R4).

Thanks. (Please e-mail answer, will summarize if interests)
-- 

 *--------------------------------*----------------------------------------*
 | Ham Operator VE2STQ            | e-mail   :   squevill@stam.qe.bell.ca  |
 | Stephane Quevillon             | envoy100 :   stephane.quevillon        |
 | OD Business, Bell Canada       | IIS      :   squevill at belvm1        |
 | Ottawa, On Canada K1G 3J4      | tel      :   (613) 785-2470            |
 *--------------------------------*----------------------------------------*

Newsgroups: comp.unix.dos-under-unix
From: mazzucch@ghost.dsi.unimi.it (massimo mazzucchi)
Subject: to connect DOS-UNIX
Keywords: info
Organization: Computer Science Dep. - Milan University
Date: Thu, 15 Oct 1992 09:12:22 GMT

Hi 
I am Max from Italy Milan

I use to connect with PC-DOs to unix bbs and net
SLIP that is very slow (S=serial.....)

i want know what are the programs to connect

UNIX-DOS more recently and very fast


Thank for your help

Bye Max

My address is mazzucch@ghost.dsi.unimi.it


Newsgroups: comp.unix.dos-under-unix
From: 81352@novell1.rz.fht-mannheim.de (Lars Detmers)
Subject: MS-Windows 3.1 under vpix (SCO 3.2.4)
Date: Tue, 13 Oct 92 08:40:39 GMT
Organization: Fachhochschule fuer Technik Mannheim

Hey Freaks,
is there a possibility to run MS-Windows 3.x under SCO UNIX 3.2.4.

Lars 
Newsgroups: comp.unix.dos-under-unix
From: alistair@microsoft.com (Alistair Banks)
Subject: Re: Multiple Users for Windows/NT
Date: 13 Oct 92 02:51:25 GMT
Organization: Microsoft Corporation

In article <4879@tivoli.UUCP> bjv@shasta.tivoli.com (Brian Vetter) writes:
>Does the Win32
>window "server" not allow this other "interactive" process to create
>new windows because of a different security ID (no xhost-like mechanism)?

The Win32 "server" runs all of its code in one security context - you
can't start multiple instances of this server, with different security
IDs, and thus all interactive processes which use this Win32 server
are limited to running their UI components with the same security ID

Non-interactive process, ie network servers, don't use the win32 server,
and so aren't limited by its only running its code in one secirity
context - therefore network server code can truly be described as
"multi-user"

Thus telnet daemons, which dont end up calling into out GUI code, but
which simply redirect tty sessions, are possible, while remote-GUI
multi-user is not - at least not in the first Windows NT release

-- Alistair
Newsgroups: comp.unix.dos-under-unix
From: katz@halcyon.com (Alan Katz)
Subject: Xlib for NT (Win32)
Keywords: xlib, nt, winsock, tcp-ip
Organization: The 23:00 News and Mail Service
Distribution: usa
Date: Thu, 15 Oct 1992 22:15:36 GMT


Greetings,

We at the Adonis Corporation (Redmond, WA) need to write X programs
which will run under Windows NT and display on remote X servers.
(Note that this is NOT the converse problem of displaying X programs
on Windows NT, which we know many others are working on).

We thus need an NT Xlib (currently no need for any X toolkits) and
would like to know if anybody has one or is in the process of porting
it.

Since the NT WinSock interface is very similar to Berkeley sockets, it
looks like a port (say from the MIT Xlib distribution) would be 
pretty straightforward.  

We would like to hear from anyone who either has such a port or might
be interested in jointly working on one.  We'd also like to hear from
anybody who is writing X applications under either Windows 3.x or 
Windows NT.

Please respond via e-mail to Katz@Adonis.Com (even though this message
is being posted from another address).

				Thanx!

				Alan Katz  (Katz@Adonis.Com)




Newsgroups: comp.unix.dos-under-unix