Relative Content

Tag Archive for stringsedreplacesolarisksh

How to remove the last occurance of back slash in string in ksh shell

var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo ‘$var’ {AES}BjW32/nnL0m78BJ/ZOEoVzXmEWzVBVZx+8Q= Expected output is {AES}BjW32/nnL0m78ef5G5B5tBJ/ZOEoVzXmEWzVBVZx+8Q= As you may see the last should not display in the output. I’m on solaris + ksh shell. Can you please suggest. I tried the below in vain: var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” | sed ‘s/\$//’ var=$(sed […]

How to remove the last occurance of back slash in string in ksh shell

var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo ‘$var’ {AES}BjW32/nnL0m78BJ/ZOEoVzXmEWzVBVZx+8Q= Expected output is {AES}BjW32/nnL0m78ef5G5B5tBJ/ZOEoVzXmEWzVBVZx+8Q= As you may see the last should not display in the output. I’m on solaris + ksh shell. Can you please suggest. I tried the below in vain: var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” | sed ‘s/\$//’ var=$(sed […]

How to remove the last occurance of back slash in string in ksh shell

var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo ‘$var’ {AES}BjW32/nnL0m78BJ/ZOEoVzXmEWzVBVZx+8Q= Expected output is {AES}BjW32/nnL0m78ef5G5B5tBJ/ZOEoVzXmEWzVBVZx+8Q= As you may see the last should not display in the output. I’m on solaris + ksh shell. Can you please suggest. I tried the below in vain: var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” | sed ‘s/\$//’ var=$(sed […]

How to remove the last occurance of back slash in string in ksh shell

var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo ‘$var’ {AES}BjW32/nnL0m78BJ/ZOEoVzXmEWzVBVZx+8Q= Expected output is {AES}BjW32/nnL0m78ef5G5B5tBJ/ZOEoVzXmEWzVBVZx+8Q= As you may see the last should not display in the output. I’m on solaris + ksh shell. Can you please suggest. I tried the below in vain: var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” | sed ‘s/\$//’ var=$(sed […]

How to remove the last occurance of back slash in string in ksh shell

var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo ‘$var’ {AES}BjW32/nnL0m78BJ/ZOEoVzXmEWzVBVZx+8Q= Expected output is {AES}BjW32/nnL0m78ef5G5B5tBJ/ZOEoVzXmEWzVBVZx+8Q= As you may see the last should not display in the output. I’m on solaris + ksh shell. Can you please suggest. I tried the below in vain: var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” | sed ‘s/\$//’ var=$(sed […]

How to remove the last occurance of back slash in string in ksh shell

var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo ‘$var’ {AES}BjW32/nnL0m78BJ/ZOEoVzXmEWzVBVZx+8Q= Expected output is {AES}BjW32/nnL0m78ef5G5B5tBJ/ZOEoVzXmEWzVBVZx+8Q= As you may see the last should not display in the output. I’m on solaris + ksh shell. Can you please suggest. I tried the below in vain: var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” var=$(sed -n ‘s/username=(.*)/1/p’ security/boot.properties); echo “${var%/}” | sed ‘s/\$//’ var=$(sed […]