PDA

View Full Version : bash skip space or mid style function


oly
March 19th, 2006, 08:46 AM
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 ???

LordHunter317
March 19th, 2006, 09:33 AM
Pipe it to cut, and tell it to remove the first character:| cut -c2-

oly
March 19th, 2006, 05:50 PM
thanks for that just what i was after :)