From owner-freebsd-hackers Tue Jul 9 08:33:44 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA16371 for hackers-outgoing; Tue, 9 Jul 1996 08:33:44 -0700 (PDT) Received: from odin.INS.CWRU.Edu (odin.INS.CWRU.Edu [129.22.8.102]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA16366 for ; Tue, 9 Jul 1996 08:33:40 -0700 (PDT) Received: (chet@localhost) by odin.INS.CWRU.Edu (8.6.12+cwru/CWRU-2.2-ins) id LAA04805; Tue, 9 Jul 1996 11:29:31 -0400 (from chet) Date: Tue, 9 Jul 1996 11:16:50 -0400 From: Chet Ramey To: koshy@india.hp.com Subject: Re: SH bugs? Cc: hackers@freebsd.org Reply-To: chet@po.CWRU.Edu In-Reply-To: Message from koshy@india.hp.com of Tue, 09 Jul 1996 09:11:55 +0530 (id <199607090341.AA093623716@fakir.india.hp.com>) Message-ID: <9607091516.AA04351.SM@odin.INS.CWRU.Edu> Read-Receipt-To: chet@po.CWRU.Edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Bug 1: > ~~~~~ > > SH does not expand wildcarded terms properly > > $ cd /tmp > $ touch bletch > $ ls bletch > bletch > $ cat < /tmp/bl* > cannot open /tmp/bl*: no such file POSIX.2 says an interactive shell is permitted to not do pathname expansion on the filename in a redirection specification. Non-interactive shells may not do it at all; interactive shells may do it only if the expansion results in a single word. The FreeBSD sh conforms to POSIX in this respect. > Bug 2: > ~~~~~~ > > CTRL-Z when executing a `for' loop works wierdly > > $ cd /tmp/ > $ for i in /usr/share/doc/handbook/*.html; do > echo $i > ln -s $i . > done > > $ jobs -l > [1] 1023 Stopped ln -s ${i} . > [2] 1077 Stopped ln -s ${i} . > [3] 1115 Stopped ln -s ${i} . > [4] 1128 Stopped ln -s ${i} . > [5] 1139 Stopped ln -s ${i} . > > These `jobs' need to be restarted explicitly : $ kill -CONT 1023 1077 .... > or $ fg %1 ... It's not all that weird. Job control works only on processes started as children of the shell. It cannot be used to suspend an entire for loop. If you want to suspend the loop as a whole, put the command in parentheses to force it into a subshell. > Bug 3: > ~~~~~~ > > `kill' doesn't accept the % syntax > > $ kill %1 > kill: illegal process id: %1 I don't think `kill' is a shell builtin on FreeBSD. Since it's an external command, it cannot know about job control identifiers. It should be possible to write a shell function to add the desired behavior to kill using the `jobid' builtin; I believe a sample is distributed with the FreeBSD sh source. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, Case Western Reserve University Internet: chet@po.CWRU.Edu