bug-bash
[Top][All Lists]
Advanced

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

Re: Questions about commandline-args


From: Christopher Roy Bratusek
Subject: Re: Questions about commandline-args
Date: Sat, 12 Nov 2011 09:07:01 +0100
User-agent: KMail/4.6 rc1 (Linux/3.0.7-zen+; KDE/4.6.5; x86_64; ; )

On Saturday 12 November 2011 02:02:01 Chris F.A. Johnson wrote:
> On Sat, 12 Nov 2011, Christopher Roy Bratusek wrote:
> > On Friday 11 November 2011 19:32:51 Chris F.A. Johnson wrote:
> >> On Fri, 11 Nov 2011, Christopher Roy Bratusek wrote:
> >>> Hi list,
> >>> 
> >>> I've got a question about commandline args, imagine:
> >>> 
> >>> personal_function ab{c,d}
> >>> 
> >>> personal_function will receive abc and abd.
> >>> Is there a way to make it receive ab{c,d}
> >>> instead (without chaning the arguement itself)?
> >>> 
> >>     Quote it: personal_function "ab{c,d}"
> > 
> > Hmm.. right. But is there a way to achieve that without quoting?
> 
>     If it is not quoted, the shell will expand it before your script
>     even sees it.
> 
> > Maybe some trap (just like for "do X before bash exists")?
> 
>     If you are calling a function, bash already exists.

I meant exits, like:

trap 'printf %s "$PWD" > $HOME/.lastpwd' EXIT

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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