2009/1/7 Miloska <miloska at gmail.com>:
> On Wed, Jan 7, 2009 at 9:23 PM, Jean-Pierre Thibert
> <jpthibert at eircom.net> wrote:
>> 1)I have a variable with a value between 00.00 to 100.00 (ie : 12.58)
>> I want to extract the integer. Something like X=int(MYVAR)
>> How to do that? I didn't find out after a lot of research.
> not nice:
> echo "12.34" | cut -d . -f 1
A bit nicer, I think:
Check the man page for details: remove a trailing pattern match from the string.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!