From owner-freebsd-bugs Fri Apr 25 12:10:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA05205 for bugs-outgoing; Fri, 25 Apr 1997 12:10:03 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA05199; Fri, 25 Apr 1997 12:10:02 -0700 (PDT) Resent-Date: Fri, 25 Apr 1997 12:10:02 -0700 (PDT) Resent-Message-Id: <199704251910.MAA05199@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, jin@adv-pc-1.lbl.gov Received: from adv-pc-1.lbl.gov (adv-pc-1.lbl.gov [128.3.196.189]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA04984 for ; Fri, 25 Apr 1997 12:04:45 -0700 (PDT) Received: (from jin@localhost) by adv-pc-1.lbl.gov (8.8.5/8.8.5) id MAA00477; Fri, 25 Apr 1997 12:04:36 -0700 (PDT) Message-Id: <199704251904.MAA00477@adv-pc-1.lbl.gov> Date: Fri, 25 Apr 1997 12:04:36 -0700 (PDT) From: "Jin Guojun[ITG]" Reply-To: jin@adv-pc-1.lbl.gov To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/3387: sh mis-interpret the file name / awk failure Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 3387 >Category: bin >Synopsis: sh mis-interpret the file name / awk failure >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 25 12:10:01 PDT 1997 >Last-Modified: >Originator: Jin Guojun[ITG] >Organization: /-------------- Jin Guojun ------------ v -- Internet: j_guojun@lbl.gov ---\ | Imaging & Distributed Computing | Usenet: ucbvax!j_guojun@lbl.gov | | Lawrence Berkeley Laboratory | Bitnet: -- | | 50B-2239, Berkeley, CA 94720 - jin%george.lbl.gov@Csa3.LBL.Gov | \--Ph#:(510) 486-7531 + Fax: 486-6363 --^--http://www-itg.lbl.gov/ITG.html-/ >Release: All FreeBSD RELEASE i386 >Environment: All FreeBSD RELEASEs >Description: In a script, if the variable for a file name had a white space at the end, the sh will treat it differently when the file name variable is used at redirected I/O, from used at fopen(). The white space is interpreted as part of the file name when I/O redirections, such as, '<', '<<', '>>', and '>' are used. This is a problem for using in a script. The FreeBSD awk generates such withe space: MyArch=`uname -v | awk -F/ '{printf $NF}` echo "=$MyArch=" =GENERIC = I am not sure which one is the problem, maybe both. >How-To-Repeat: For awk problem, see Description above. Below is the sh issue: % more abc file abc is a testing file % more test.script FILE_NAME="abc " more < $FILE_NAME echo "=$FILE_NAME=" more $FILE_NAME % test.script test.script: cannot open abc : no such file =abc = file abc is a testing file >Fix: one of them has to be fixed, but I do know which (-: Maybe both? >Audit-Trail: >Unformatted: