#1 (permalink)  
Old 04-09-2004, 07:53 AM
Registered User
 
Join Date: Feb 2004
Posts: 95
laborspy
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"`
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2004, 09:57 AM
chirpy's Avatar
Moderator
 
Join Date: Jun 2002
Location: Go on, have a guess
Posts: 13,495
chirpy will become famous soon enough
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:40 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc