get a substring with a bash command
Hi,
i've a file that has the following content: <param>1</param> <param>2</param> <param>3</param> ... <param>n</param> I want to use a bash command that put to the output only the values: 1 2 3 ... n How is this possible? Thanks, Pedro |
Code:
sed 's/^<param>\(.*\)<\/param>$/\1/' |
Thanks, for the answer.
And, which bash command should i use to remove the spaces from the beginning of each line? Thanks, Pedro |
sed 's/^ *//g' file
to see output sed -i.bak 's/^ *//g' file to edit file in place and make backup |
Thanks for the aswner
|
All times are GMT -5. The time now is 06:58 AM. |