Results 1 to 3 of 3

Thread: bash skip space or mid style function

  1. #1
    Join Date
    Dec 2004
    Beans
    172
    Distro
    Ubuntu Development Release

    bash skip space or mid style function

    i have been writting a script to setup a ldap directory i wanted to make it also set up samba as a PDC but have hit a snag with my scripting knowledge.

    I am trying to get a SID number but i only want the number, i have managed to achieve this except it has a space in front of it is there a way i can remove spaces from the output ??

    sudo net getlocalsid | awk -F: '{print $2}'

    that returns what i want but with a space at the start, can anyone help me with something that will also remove the space ???

  2. #2
    Join Date
    Nov 2004
    Beans
    2,614

    Re: bash skip space or mid style function

    Pipe it to cut, and tell it to remove the first character:
    Code:
    | cut -c2-

  3. #3
    Join Date
    Dec 2004
    Beans
    172
    Distro
    Ubuntu Development Release

    Re: bash skip space or mid style function

    thanks for that just what i was after

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •