help-bash
[
Top
][
All Lists
]
Advanced
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
[Help-bash] Getting rid of white space with % and %%
From
:
Bill Gradwohl
Subject
:
[Help-bash] Getting rid of white space with % and %%
Date
:
Mon, 21 May 2012 15:17:53 -0600
I noticed it's apparently legit to say the following:
string='hello this is a test '
echo "'${string}'" original
echo "'${string%[[:space:]]}'"
echo "'${string%[[:space:]]*}'"
echo "'${string%%[[:space:]]*}'"
Produces:
address@hidden ycc# ./tst
'hello this is a test ' original
'hello this is a test '
'hello this is a test '
'hello'
I tried it with a tab character at the end of the string and that also works.
Is there any syntactically correct way to provide an * or + multiplier on to this to get rid of all the white space at the end of a line?
--
Bill Gradwohl
reply via email to
[Prev in Thread]
Current Thread
[
Next in Thread
]
[Help-bash] Getting rid of white space with % and %%
,
Bill Gradwohl
<=
Re: [Help-bash] Getting rid of white space with % and %%
,
Greg Wooledge
,
2012/05/21
Re: [Help-bash] Getting rid of white space with % and %%
,
Bill Gradwohl
,
2012/05/21
Re: [Help-bash] Getting rid of white space with % and %%
,
Eric Blake
,
2012/05/21
Re: [Help-bash] Getting rid of white space with % and %%
,
Bill Gradwohl
,
2012/05/21
Re: [Help-bash] Getting rid of white space with % and %%
,
clark wang
,
2012/05/21
Prev by Date:
Re: [Help-bash] Quick prepend to file using echo
Next by Date:
Re: [Help-bash] Getting rid of white space with % and %%
Previous by thread:
[Help-bash] Quick prepend to file using echo
Next by thread:
Re: [Help-bash] Getting rid of white space with % and %%
Index(es):
Date
Thread