[Cialug] The systemd Init System

kristau kristau at gmail.com
Fri Feb 12 16:02:04 CST 2016


This Very Much:

"Even better, put the modification time in the filename, in YYYYMMDD
format, so that glob order is also mtime order. Then you don't need ls
or perl or anything. (The vast majority of cases where people want the
oldest or newest file in a directory can be solved just by doing
this.)"

On Fri, Feb 12, 2016 at 1:08 PM, Todd Walton <tdwalton at gmail.com> wrote:
> On Wed, Dec 16, 2015 at 11:48 AM, Todd Walton <tdwalton at gmail.com> wrote:
>
>>
>> Huh. I was about to respond to Scott in this way, but you beat me to it,
>> Jim. Although I'd probably say it died soft, not hard. The remnants are
>> still there.
>>
>> The root problem, imho, is that the "one thing" unit needs to be
>> refactored, updated for the modern age. And text output is great at the end
>> of the pipe, but it's not always great for the core utils talking to each
>> other, so you get things like find with the mutant arms of -exec and
>> -print0.
>>
>> And oh how I wish someone would rewrite ls to sort better, align better,
>> etc.
>>
>
> And on that note... Enumerating files or doing stuff with files:
> http://mywiki.wooledge.org/ParsingLs
>
> ===============
> # Good!
> for f in *; do
>     [[ -e $f ]] || continue
>     ...
> done
> ===============
> ===============
> # BAD! Don't do this!
> for f in $(ls); do
>     ...
> done
> ===============
>
> *cough* objects *cough*
>
> --
> Todd
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug



-- 
Tired programmer
Coding late into the night
The core dump follows


More information about the Cialug mailing list