Mailing List Archive


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

Re: [tlug] Bourne / bash problem



On Sun, Apr 5, 2009 at 8:25 AM, Stephen Lee <sl-tlug@example.com> wrote:
> Bruno Raoult <braoult@example.com> wrote:
>>
>> I am writing some script, with commands like ffmpeg, handbrake,
>> or some video editing commands. They all take zillion of parameters,
>
> How about something like this?
>
> # comment
> options=--option1
> # comment
> options+=\ --option2
> # comment
> options+=\ --option3
> # here goes the command
> command $options
>
> Though this may get a bit tricky if your options include shell
> metacharacters or significant whitespaces, then you'll have to
> escape them correctly.

Something like that will work, but this is more of a case of
Doctor, Doctor it hurts when I do this!  So, don't do that.

I'm fortunate to have a guaranteed /bin/zsh regardless
of whether my script runs on Solaris or Linux at work,
but I know others are not so fortunate otherwise I would
recommend that.  It has the best quoting syntax of the
POSIX compliant shells.

-sb


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links