help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] inconsistency in expansions


From: Bill Gradwohl
Subject: Re: [Help-bash] inconsistency in expansions
Date: Mon, 7 May 2012 07:27:29 -0600

On Mon, May 7, 2012 at 4:15 AM, John Kearney <address@hidden> wrote:
Actually I'm a bit confused now.
Why this doesn't work
${${#}}

Anyway as a work around these work.
${@:${#}:1}
or
${@:(-1):1}


or for your example
echo "${*%${@:(-1):1}}"
echo "${*%${@:${#}:1}}"

That's the code I ended up using before I posted my question.

My first attempt was trying to do it via the string manipulation route since I thought it would work. Apparently not.

Thanks for the suggestion.

--
Bill Gradwohl


reply via email to

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