change last character using sed
Hi everyone.
I have a bunch of files like the following one: Code:
dn: Identifier=3AM9,c=MX,l=world e.g. Code:
userPassword: {SHA}fGphxo74ubawYbKMNIvB7Xkhy1M= Code:
$ sed '/userPassword/s/:/=/' file.ldif |
Code:
for fname in *.ldif ; do sed '/userPassword/s/:/=/' $fname ; done |
Hey syg00, thaks for your quick response.
I think i didn't explain myself well. the loop is not the problem, the problem here is that my sed command is not right. if you look close to the output my sed command's output is: Code:
userPassword= {SHA}fGphxo74ubawYbKMNIvB7Xkhy1M: Code:
userPassword: {SHA}fGphxo74ubawYbKMNIvB7Xkhy1M= |
I believe i found the answer
Code:
for i in *.ldif ; do sed '/userPassword/s/M:/M=/g' $i > "$i"_.txt; done |
Oops - sed uses anchors; "$" is end of line - maybe
Code:
sed '/userPassword/ s/:$/=/' |
Thank you. I will give it a shot. Let you know.
|
All times are GMT -5. The time now is 10:32 PM. |