List Info

Thread: Strange action when testing blfs_tool




Strange action when testing blfs_tool
user name
2006-08-30 01:53:00
George Boudreau wrote:

>   This is a head scratcher if you have never seen it
before.

Hi George

I've hit this exact same problem in gsbuild due to the way
I handle the
scriptlets. If I need a conditional on the last line of a
scriptlet, I
work around it by using an if/then instead of a &&.
I'm sure this
behavior must be documented in the bash manual somewhere..
but buggered if
I can find it :-(  Some quirkiness due to curly braces
methinks..

>   [[ $ = "y" ]] && func2

replace that line with

if [[ $ = "y" ]]; then func2; fi

and it'll do what you want.

Regards
Greg
-- 
http://www.diy-linux.org/

-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Strange action when testing blfs_tool
user name
2006-08-30 02:06:59
Greg Schafer wrote:
> George Boudreau wrote:
> 
>>   This is a head scratcher if you have never seen
it before.
> 
> Hi George
> 
> I've hit this exact same problem in gsbuild due to the
way I handle the
> scriptlets. If I need a conditional on the last line of
a scriptlet, I
> work around it by using an if/then instead of a
&&. I'm sure this
> behavior must be documented in the bash manual
somewhere.. but buggered if
> I can find it :-(  Some quirkiness due to curly braces
methinks..
> 
>>   [[ $ = "y" ]] && func2
> 
> replace that line with
> 
> if [[ $ = "y" ]]; then func2; fi
> 
> and it'll do what you want.
   Hey Grep,
    Yep.. that would be the 'standard' conditional format.
Taking a 
shortcut sometimes takes longer    The
addition of a bash 'noop' will 
also satisfy bash's interpreter parser.

   (how's your new toy..?)
> 
> Regards
> Greg

-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Strange action when testing blfs_tool
user name
2006-08-30 02:23:42
On 8/29/06, George Boudreau <georgeblinuxfromscratch.org> wrote:

>    Hey Grep,

I think someone's mind is getting polluted by shell
scripting. 

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Strange action when testing blfs_tool
user name
2006-08-30 06:33:03
> >   [[ $ = "y" ]] && func2
> 
> replace that line with
> 
> if [[ $ = "y" ]]; then func2; fi
> 
> and it'll do what you want.

This will also work.

[[ $ = "y" ]] && func2 || true

Kind Regards,
Ario


  I like Salmonfish .


		
____________________________________________________ 
Do you Yahoo!?  
Great meals in less than 30 mins - Family Circle Sept – out
now 
http://www.familycircl
e.com.au 

-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )