NetBSD Problem Report #35270

From  Mon Dec 18 03:05:59 2006
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id DC24E63B8C9
	for <>; Mon, 18 Dec 2006 03:05:58 +0000 (UTC)
Message-Id: <>
Date: Mon, 18 Dec 2006 04:02:11 +0100 (CET)
Subject: globbing/redirection bug in csh
X-Send-Pr-Version: 3.95

>Number:         35270
>Category:       bin
>Synopsis:       globbing/redirection bug in csh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 18 03:10:01 +0000 2006
>Last-Modified:  Tue Jul 17 04:53:50 +0000 2007
>Originator:     Lasse H Petersen
>Release:        NetBSD 4.99.4
	Not terribly organised.

System: NetBSD 4.99.4 NetBSD 4.99.4 (GENERIC.MP) #0: Fri Nov 24 11:47:13 UTC 2006 i386
Architecture: i386
Machine: i386

	This problem is not restricted to NetBSD, but seems to
	affect many, possibly all implementations of csh, including tcsh.

	When executing a command in csh, like
	command * >fil
	the file fil is created before the * is expanded, and as
	a result the file fil is included as argument to the command.
	If the command is for example a cat or grep, it may append
	the file fil onto itself, until the filesystem is full.


	$ csh
	% mkdir foo
	% cd foo
	% touch a
	% echo *>foobar
	% cat foobar
	a foobar

	This is apparantly a bug in several csh implementations.
	A workaround, which could also be called a fix, would be
	not to use csh. This could be mandated by removing csh
	altogether, or suggested through addition of a comment in
	the bug section of the man page.

	A proper fix would be to change the order of globbing and
	redirection, so that the globbing is done before the stdout
	redirect file is created, or so that this file is filtered
	out from the resulting list of files.




NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.