delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/24/17:22:57

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=2.8 required=5.0 tests=AWL,BAYES_05
X-Spam-Check-By: sourceware.org
X-MXL-Hash: 4c9d16a171c1170d-e6cd45edad02121a821899327a98c67c2b1588ed
X-MXL-Hash: 4c9d169d207ac4ff-f2bac61062a84466f132ad21d174ff6ae3cf0e5e
From: "Conway, Timothy" <Timothy DOT Conway AT jbssa DOT com>
To: "melkor AT orangepalantir DOT org" <melkor AT orangepalantir DOT org>,
"cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Date: Fri, 24 Sep 2010 15:21:35 -0600
Subject: RE: backtics
Message-ID: <2D3A1913B8E5264CA1FE965AFEB209D5143316F415@USCOGR00EXC4AI.global.corp.prod>
References: <79eb8d2be6552119c923d635791104be DOT squirrel AT orangepalantir DOT org>
In-Reply-To: <79eb8d2be6552119c923d635791104be.squirrel@orangepalantir.org>
MIME-Version: 1.0
X-MAIL-FROM: <timothy DOT conway AT jbssa DOT com>
X-AnalysisOut: [v=1.0 c=1 a=BLceEmwcHowA:10 a=kj9zAlcOel0A:10 a=xqWC_Br6kY]
X-AnalysisOut: [4A:10 a=VGGvZi2svHTA78JB6+TOvQ==:17 a=ycUMuiNEe60FVIhcnmsA]
X-AnalysisOut: [:9 a=ey9qSr8ENb5ZRvPQN4NKN_VSPtIA:4 a=CjuIK1q_8ugA:10]
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

This probably isn't a backtic problem, but using backtics causes it.

ls `ls`

results in file not found errors. ie:

bash-3.2$ ls
35ms  40ms  80ms
bash-3.2$ ls `ls`
ls: cannot access 35ms: No such file or directory
ls: cannot access 40ms: No such file or directory
ls: cannot access 80ms: No such file or directory bash-3.2$

++++++++++++++++++++++++++++++++++

Almost certainly we're looking at whitespace characters.  "ls" reads the di=
rectory and displays the names., but command expansion delivers them as a w=
hitespace-delimited array.  Here's the same thing duplicated several ways o=
n AIX.


tconway AT tsmserv
/home/tconway>mkdir whitespace
tconway AT tsmserv
/home/tconway>cd whitespace
tconway AT tsmserv
/home/tconway/whitespace>touch '35ms '  '40ms '  '80ms '
tconway AT tsmserv
/home/tconway/whitespace>ls
35ms   40ms   80ms=20
tconway AT tsmserv
/home/tconway/whitespace>ls `ls`
ls: 0653-341 The file 35ms does not exist.
ls: 0653-341 The file 40ms does not exist.
ls: 0653-341 The file 80ms does not exist.
tconway AT tsmserv
/home/tconway/whitespace>ls |cat -vet
35ms $
40ms $
80ms $
tconway AT tsmserv
/home/tconway/whitespace>cd ..
tconway AT tsmserv
/home/tconway>rm -rf whitespace
tconway AT tsmserv
/home/tconway/whitespace>rm '35ms '  '40ms '  '80ms '
tconway AT tsmserv
/home/tconway/whitespace>touch '
35ms' '40ms=20
> ' ' 80 ms      '
tconway AT tsmserv
/home/tconway/whitespace>ls

35ms   80 ms       40ms

tconway AT tsmserv
/home/tconway/whitespace>ls `ls`
ls: 0653-341 The file 35ms does not exist.
ls: 0653-341 The file 80 does not exist.
ls: 0653-341 The file ms does not exist.
ls: 0653-341 The file 40ms does not exist.
tconway AT tsmserv
/home/tconway/whitespace>ls |cat -vet
$
35ms$
 80 ms^I $
40ms$
$
tconway AT tsmserv
/home/tconway/whitespace>rm *
tconway AT tsmserv
/home/tconway/whitespace>touch '35ms  40ms  80ms'
tconway AT tsmserv
/home/tconway/whitespace>ls
35ms  40ms  80ms
tconway AT tsmserv
/home/tconway/whitespace>ls `ls`
ls: 0653-341 The file 35ms does not exist.
ls: 0653-341 The file 40ms does not exist.
ls: 0653-341 The file 80ms does not exist.
tconway AT tsmserv
/home/tconway/whitespace>ls |cat -vet
35ms  40ms  80ms$
tconway AT tsmserv
/home/tconway/whitespace>rm *
tconway AT tsmserv
/home/tconway/whitespace>touch "`(time sleep 1) 2>&1`"
tconway AT tsmserv
/home/tconway/whitespace>ls

real    0m1.002s
user    0m0.001s
sys     0m0.001s
tconway AT tsmserv
/home/tconway/whitespace>ls -l
total 0
-rw-r--r--    1 tconway  admins            0 Sep 24 15:19=20
real    0m1.002s
user    0m0.001s
sys     0m0.001s
tconway AT tsmserv
/home/tconway/whitespace>rm *
tconway AT tsmserv
/home/tconway/whitespace>touch "Hello.  I am a unix file.
> I'm still just this one single file, but I have many lines
> in my name.  I even have \"all three\" types of \\quotes in my name"
tconway AT tsmserv
/home/tconway/whitespace>ls
Hello.  I am a unix file.
I'm still just this one single file, but I have many lines
in my name.  I even have "all three" types of \quotes in my name
tconway AT tsmserv
/home/tconway/whitespace>ls -l
total 0
-rw-r--r--    1 tconway  admins            0 Sep 24 15:15 Hello.  I am a un=
ix file.
I'm still just this one single file, but I have many lines
in my name.  I even have "all three" types of \quotes in my name
tconway AT tsmserv
/home/tconway/whitespace>cd ..
tconway AT tsmserv
/home/tconway>rm -rf whitespace
tconway AT tsmserv
/home/tconway>

That last one's a funny one to drop on a new unix user.





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019