Re: BASH no longer does 'for i in $(ls); do ls $i; done'??

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



On Wed, 2010-05-19 at 01:41 -0500, David C. Rankin wrote:
> So the bottom line is don't alias 'ls'. And, I guess, the next
> question would
> be, how or where can I safely customize the behavior of ls without
> screwing
> myself again. 

Solution is simple: don't use ls for the for loops you're doing. I just
tested it on my system, the colored files and directories give "No such
file or directory", which makes sense, as the variable contains ascii
chars for color information.

I would suggest using globbing, why would you use for i in $(ls); while
you can use for i in *;



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux