On 26/07/2024 09:25, Andy Smith wrote:
On Fri, Jul 26, 2024 at 10:00:48AM +0800, cor...@free.fr wrote:
$ sudo ls -ltr "/tmp/$(ls /tmp |grep apache)"
[...]
So what is wrong with just using a glob as suggested?
Not all people are realizing how many pitfalls they may face using
shell. (I admit my example with findmnt likely has a shortcoming as well.)
I am realizing that the following pages describe dealing with lists
while single directory is expected in the current case, but still
https://mywiki.wooledge.org/ParsingLs
Why you shouldn't parse the output of ls(1)
https://mywiki.wooledge.org/BashPitfalls#for_f_in_.24.28ls_.2A.mp3.29
for f in $(ls *.mp3)
No 1 in Bash Pitfalls