--
Rich Teer
President,
Rite Online Inc.
Voice: +1 (250) 979-1638
URL: http://www.rite-online.net
> > Hi,
> > I was windering if there was a way to strip off the invisible null at
the
> > end of a string.
> > Lets say I have taken a string and split it into individual components.
> > ie: i am canadian
> > var1 = i
> > var2 = am
> > var3 = canadian\0
> > How do I get rid of the \0 at the end of canadian???
> > Any help would be great!
> I don't think you're understanding C strings: ALL strings in C
> are NUL terminated, by definition. In other words,
> var1 = i\0
> var2 = am\0
> var3 = canadian\0
> --
> Rich Teer
> President,
> Rite Online Inc.
> Voice: +1 (250) 979-1638
> URL: http://www.rite-online.net
DS
1. Stripping trailing blanks in a string.
This works for me:
sed -e 's/ *$//'
Cheers,
Zoran
--
char *Disclaimer = "My opinions only. Use at your own risk.";
char *Murphy = "NON-RECIPROCAL LAWS OF EXPECTATIONS:"
" Negative expectations yield negative results."
" Positive expectations yield negative results.";
2. Lots of questions about tux and kernel setup
3. Stripping off path names: "find" and variables
5. Stripping ^M off ftp, binary transfered files
6. Samba: How to join an NT domain?
7. stripping off control characters
8. Scientific Graphics Library for live graphics
9. Stripping off extensions for decompress() function
11. Linux stripping off VLAN header
12. stripping bits off enviroment variables: $FILE
13. why spaces stripped off ??