On Mon, Jan 31, 2000 at 07:48:38PM +0200, Ralf Christian Strandell wrote:
> Hello!
> 
> How do I remove the last character of a string
> stored in an environmental variable?
> 
> ie. if $VAR=abcd then how do I get $VAR=abc ?
> 
> ----------
> I need this to keep track of position in
> a menu tree.
> 
> Ralf

VAR=${VAR:0:${#VAR}-1}
works in bash 2.03.0(1)
this is shell specific however. You should check out the man page
for whatever shell you are using, that's where I figured this out.

enjoy


greg

-- 
this is not here

----- End forwarded message -----

-- 
this is not here

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to