🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

6 total messages Started by the main man Thu, 31 Jan 1991 03:55
Wierd shell bug could be useful
#336
Author: the main man
Date: Thu, 31 Jan 1991 03:55
20 lines
637 bytes
Try this out:
	$ echo > foo '
	> garbage
	> ...
	> ...
	> ...
	> ...
	> '
	$

Then cat foo. This is a wierd bug but could be used instead of:
	cat << ! > foo
	garbage
	...
	...
	...
	...
	!

A user friendly bug !!!
Re: Weird shell bug could be useful
#337
Author: Tom Christiansen
Date: Wed, 30 Jan 1991 18:31
29 lines
1268 bytes
From the keyboard of root@tndsyd.oz (the main man):
:Try this out:
:	$ echo > foo '
:	> garbage
:	> ...
:	> ...
:	> ...
:	> ...
:	> '
:	$
:
:Then cat foo. This is a wierd bug but could be used instead of:
:	cat << ! > foo
:	garbage
:	...
:	...
:	...
:	...
:	!

That's not a bug -- it's a feature.  That the csh doesn't do 
the right thing here is its problem; real shells are defined to 
behave in just this way.  If it ever stops working, complain.

--tom
--
"Hey, did you hear Stallman has replaced /vmunix with /vmunix.el?  Now
 he can finally have the whole O/S built-in to his editor like he
 always wanted!" --me (Tom Christiansen <tchrist@convex.com>)
Re: Wierd shell bug could be useful
#338
Author: Doug Gwyn
Date: Wed, 30 Jan 1991 19:09
9 lines
687 bytes
In article <618@tndsyd.oz> root@tndsyd.oz (the main man) writes:
>Try this out:
>	$ echo > foo '
>	> garbage
>	> '
>A user friendly bug !!!

What do you mean, bug?  The Bourne shell has always been advertised
as accepting I/O redirections anywhere among the arguments.
Re: Wierd shell bug could be useful
#340
Author: Harald.Eikrem
Date: Wed, 30 Jan 1991 20:06
50 lines
1235 bytes
said root@tndsyd.oz    [which is no valid internet mail address --H.E]:

> Try this out:
> 	$ echo > foo '
> 	> garbage
> 	> ...
> 	> ...
> 	> ...
> 	> ...
> 	> '
> 	$
> 
> Then cat foo. This is a wierd bug but could be used instead of:
> 	cat << ! > foo
> 	garbage
> 	...
> 	...
> 	...
> 	...
> 	!
> 
> A user friendly bug !!!

What do you mean is a bug here?  This behaves perfecly normal to me, and of
course the two methods produce different results.

$ echo > foo '
> bar
> and
> grill
> '
$ cat foo    

bar
and
grill

$ cat << ! > foo
> bar
> and
> grill
> !
$ cat foo
bar
and
grill
$ 


--Harald E
Re: Wierd shell bug could be useful
#339
Author: Sean Eric Fagan
Date: Wed, 30 Jan 1991 20:25
14 lines
898 bytes
In article <618@tndsyd.oz> root@tndsyd.oz (the main man) writes:
>Try this out:
>	$ echo > foo '
>	> garbage
>	> '

Uhm, why do you consider this a bug?  That's doing exactly what I would
expect it to.

-- 
Sean Eric Fagan  | "I made the universe, but please don't blame me for it;
sef@kithrup.COM  |  I had a bellyache at the time."
-----------------+           -- The Turtle (Stephen King, _It_)
Any opinions expressed are my own, and generally unpopular with others.
Re: Wierd shell bug could be useful
#349
Author: Jeff Beadles
Date: Sat, 02 Feb 1991 02:31
19 lines
822 bytes
In article <618@tndsyd.oz> root@tndsyd.oz (the main man) writes:
>Try this out:
>	$ echo > foo '
>	> garbage
>	> '
>	$

This is not a bug!  I often write scripts with something like this:

$ < file program > file2

The shell will allow redirection operators ('<' and '>') most anywhere.

It's not a bug, it's a FEATURE! :-)


	-Jeff
-- 
Jeff Beadles		jeff@onion.rain.com
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