|
|||
|
shell script: remove everything behind .'s
Does anyone know how to remove everything and including the .'s in a shell script. Right now I can remove the .'s but I don't know how to delete the other numbers.
Val = `echo $1 | sed "s/\.//g"` |
|
||||
|
If you mean that you want to remove everything after the dot, then, if the regex follows the perl usage, the following should work:
Code:
Val = `echo $1 | sed "s/\..*//g"`
__________________
Jonathan Michaelson cPanel Forum Moderator Need your cPanel servers secured and tuned? cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf http://www.configserver.com |
![]() |
| Thread Tools | |
| Display Modes | |
|
|