parallel
[Top][All Lists]
Advanced

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

Re: sem example in man page is broken if there are spaces in the filenam


From: Abon B
Subject: Re: sem example in man page is broken if there are spaces in the filenames
Date: Fri, 14 Aug 2020 05:37:51 +0000

I just read the QUOTING section (sorry for missing it). It looks like -q
option solves the issue for my use case (single encoder command for
media files) and the man page example could be fixed by changing $i to
\"$i\".

Perhaps that section and the -q option should also be mentioned in the
`sem' man page to highlight them?


On Thu, Aug 13, 2020 at 7:28 PM Abon B <gnuabonbon@gmail.com> wrote:
>
> Consider the following example in the `sem' man page:
>
>          for i in *.log ; do
>            echo $i
>            sem -j+0 gzip $i ";" echo done
>          done
>          sem --wait
>
> If any of the log files have spaces in them, then gzip considers the
> space a separator
> and is called on each part of the filename.
>
> Example:
>
> touch 'example log with spaces.log'
> for i in *.log; do echo $i; sem -j+0 gzip $i ";" echo done; done
>
> Output:
>
> done
> gzip: example: No such file or directory
> gzip: log: No such file or directory
> gzip: with: No such file or directory
> gzip: spaces.log: No such file or directory
>
> This occurs even when putting quotes around the $i.
>
> What's the best way to use the semaphore behavior with such input?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]