Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Feb 2004
    Posts
    95

    Default 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"`

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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

    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

Similar Threads & Tags
Similar threads

  1. Replies: 14
    Last Post: 02-25-2011, 07:16 PM
  2. Shell script for getting addon domains
    By AndyB78 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-22-2010, 12:48 PM
  3. Find and Remove bad files with shell
    By paulmulder in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-16-2007, 11:19 AM
  4. help me do this shell script
    By s_2_s in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 02-12-2005, 11:25 PM
  5. Automating Account Creation: Shell Script? PHP Script?
    By RangerWest in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-13-2003, 10:24 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube