Search Results

Search: Posts Made By: Lem
16,862
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...
16,862
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...
942
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...
2,787
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,007
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

 

Featured Tech Videos

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