bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls doesn't work in if statements in bash 4.3


From: Eduardo A . Bustamante López
Subject: Re: ls doesn't work in if statements in bash 4.3
Date: Thu, 27 Mar 2014 11:15:22 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

> Your response is "I recommend you to use 'set -x'"?  Nice.  Unfortunately it 
> also means you're a troll, so further discussion with you is pointless.
>   

Well, care to explain why I'm labeled as a troll?


I ran the following:

  | bash-4.3$ mkdir a b c
  | bash-4.3$ touch 1 2 3
  | bash-4.3$ (set -x; echo '===1'; for file in `ls --color=never`; do [ -e 
"$file" ] && echo "$file"; done; echo '===2'; for file in `ls --color=always`; 
do [ -e "$file" ] && echo "$file"; done;)
  | + echo ===1
  | ===1
  | ++ ls --color=never
  | + for file in '`ls --color=never`'
  | + '[' -e 1 ']'
  | + echo 1
  | 1
  | + for file in '`ls --color=never`'
  | + '[' -e 2 ']'
  | + echo 2
  | 2
  | + for file in '`ls --color=never`'
  | + '[' -e 3 ']'
  | + echo 3
  | 3
  | + for file in '`ls --color=never`'
  | + '[' -e a ']'
  | + echo a
  | a
  | + for file in '`ls --color=never`'
  | + '[' -e b ']'
  | + echo b
  | b
  | + for file in '`ls --color=never`'
  | + '[' -e c ']'
  | + echo c
  | c
  | + echo ===2
  | ===2
  | ++ ls --color=always
  | + for file in '`ls --color=always`'
  | + '[' -e 1 ']'
  | + echo 1
  | 1
  | + for file in '`ls --color=always`'
  | + '[' -e 2 ']'
  | + echo 2
  | 2
  | + for file in '`ls --color=always`'
  | + '[' -e 3 ']'
  | + echo 3
  | 3
  | + for file in '`ls --color=always`'
  | + '[' -e 'a' ']'
  | + for file in '`ls --color=always`'
  | + '[' -e 'b' ']'
  | + for file in '`ls --color=always`'
  | + '[' -e 'c' ']'


Due to limitations on what can be sent by email, you won't be able to
notice that the last three entries are shown in color. But running
this on a terminal will make that evident quickly. And this would've
hinted you immediately what the issue was.

(but hey, I'm a troll ;) )




---
Also, on a slightly different issue, please... really, please, use
Google Groups properly. It's VERY annoying to have to skip through
pages of text just to see your 1 line reply. Also, it appears as if
you're replying to yourself. This makes it hard to know who you're
talking to.

Follow the suggestions here to make the experience less painful to us
who have to read you: https://wiki.python.org/moin/GoogleGroupsPython

-- 
Eduardo Alan Bustamante López



reply via email to

[Prev in Thread] Current Thread [Next in Thread]