[SunHELP] data manipulation
Ivan Kovalev
sunhelp at sunhelp.org
Wed Nov 29 18:52:19 CST 2000
${word%?} in ksh would do the trick of removing last character.
Ivan
dhansen at zebra.net wrote:
>
> Fuerst, Robert C. wrote:
> >I thought the best fix for this was dos2unix?
>
> Wouldn't IFS be the best (most efficient) fix for this situation?
> i.e.-
>
> #!/bin/sh
> trap "" 2 3
> echo "type something"
> IFS="${IFS}`echo \"\r\c\"`" read inputVar trashVar
> echo "request was " $inputVar
> echo finished
> exit
> trap 2 3
>
> >Van Niekerk, Ronelle wrote:
> >>Hi guys,
> >>I'm writing a script and have come across an irritating problem. THe
> >>scripts accepts data eg: word, in from a tcp port and writes it to a file
> >>as: word^M.
> >>I know you can't see the ^M when you cat or more the file - but it is
> >>still there.
> >>Is there a command or environment setting that I can use that will tell my
> >>script to ignore
> this?
>
> _______________________________________________
> SunHELP maillist - SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp
More information about the SunHELP
mailing list