Search Results

Search: Posts Made By: Lem
22,397
Posted By alister
I realize that you are aware that your suggestion...
I realize that you are aware that your suggestion isn't elegant, but aside from that its utility is very limited. It may work for that small sample, but it won't scale. In this case, the delay is...
22,397
Posted By alister
The blame for that behavior almost certainly lies...
The blame for that behavior almost certainly lies with your ls implementation. Which ls are you using?

I can reproduce that behavior with GNU ls. I cannot reproduce it with busybox ls. A closer...
1,307
Posted By alister
Multiple processes are writing to the same file....
Multiple processes are writing to the same file. Some of the streams are unbuffered (stderr) and some are buffered (stdout). You are at the mercies of the c library's stream buffering and the system...
4,881
Posted By alister
That's an unsafe and unreliable way to work with...
That's an unsafe and unreliable way to work with a list of filenames.


$ mkdir test && cd test
$ touch -- '?' '[a]' a '-n'
$ ls -1
?
a
[a]
-n
$ ls | while IFS= read -r f; do printf '%s\n'...
1,543
Posted By alister
Keeping with that spirit, here's one in sh: ...
Keeping with that spirit, here's one in sh:

while IFS=\| read -r x y z; do
while [ ${#y} -lt 10 ]; do
y=${y}0
done
printf '%s|%s|%s\n' "$x" "$y" "$z"
done


Welcome to...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 08:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy