Replace slash in Bash

前端 未结 5 1804
迷失自我
迷失自我 2020-12-28 12:54

Let\'s suppose I have this variable:

DATE=\"04/Jun/2014:15:54:26\".

Therein I need to replace / with \\/ in order to

5条回答
  •  独厮守ぢ
    2020-12-28 13:30

    You can also escape the slashes, with a slightly less readable solution than with hashes:

    echo "04/Jun/2014:15:54:26" | sed 's/\//\\\//g'

提交回复
热议问题