Show Password

Hello Unregistered
Welcome from United States
You are somewhere around Ashburn
Last Visit: 1 Minute Ago @ 03:22 PM
Bits: 0
UNIX Time: 1531682524


How to replace special characters?

UNIX for Advanced & Expert Users

Kindly Note - This is a Single User Post by Forum Member wisecracker Regarding:
How to replace special characters?.
Please Follow The Primary Link Above to View the Full Discussion.

Old 04-21-2017   -   Original Discussion by Ravi.K
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
Join Date: Jan 2013
Last Activity: 15 July 2018, 2:34 PM EDT
Location: Loughborough
Posts: 1,286
Thanks: 387
Thanked 351 Times in 276 Posts
Why use sed?
Longhand using OSX 10.12.4, default bash terminal.
(Assumption bash is available.)
Interactive mode is a great way to test.

Last login: Fri Apr 21 22:35:25 on ttys000
AMIGA:amiga~> STRING='|*|.5|*|0.2|*|A.B|*|'
AMIGA:amiga~> PREFIX="|*|0"
AMIGA:amiga~> echo "$PREFIX${STRING:3}"
AMIGA:amiga~> _

The Following User Says Thank You to wisecracker For This Useful Post:
jim mcnamara (04-21-2017)