help with sh script

FreeBSD questions mailing list FreeBSD at amadeus.demon.nl
Sun Jul 3 19:21:56 GMT 2005


On 03 jul 2005, at 20:59, fbsd_user wrote:

>
>
> std_text='No ALTQ support in kernel ALTQ related functions disabled'
> ret_ob='No ALTQ support in kernel ALTQ related functions disabled
> OK'
>
> ret_ob=`printf "$ret_ob" | sed 's/\$std_text//g'`
> Does not strip off the std_text stuff.
>
> How would I code a statement to remove everything from $ret_ob
> but the ok at the end so $ret_ob would only contain the ok??
>
> Some times $ret_ob will end in some error message and that is
> what I want to capture after striping off the std_text.
>
>
> Thanks
>
hmm try this then:

ret_ob=`printf "$ret_ob" | tr -d "$std_text"`

Arno


More information about the freebsd-questions mailing list