Expand "{file1,file2}"
Miguel A. Reynoso
tallerlinux at gmail.com
Thu Apr 21 22:48:10 UTC 2011
On 21/04/11 20:08, Harald Becker wrote:
> Hi Miguel!
>
>>> On 21.04.2011 20:12, Miguel A. Reynoso wrote:
>>>> strip src/{vpm,vpmbulk}
>>>> Its possible use busybox ash applet with this expand commands ??.
>>> Brace expansions are a bash-ishm extension not available in ash.
>>>
>> Thank's so much Harald.
> You may consider to use the following construct:
>
> for f in vpm vpmbulk
> do strip "src/$f"
> done
>
> This works in ash, bash and probably in any other POSIX compliant shell.
> May be combined with globing features like in:
>
> cd your_globing_base_directory
> for f in xyz-* abc* u*.txt ??x??.*
> do put_your_commands_here_using "$f"
> # needs quoting of $f in case of space or special characters in file name
> # else not required
> done
>
> For more informations see ash (1) manual page (use Google etc. if you do
> not have that manual page on your local machine).
>
> --
> Harald
>
Thanks for your suggestions. I have read the mapage of ash and I'm
making the necessary changes in my sh code to make it fully POSIX
compilance and busybox compatible.
More information about the busybox
mailing list