Let's suppose I have this variable:
DATE="04/Jun/2014:15:54:26".
DATE="04/Jun/2014:15:54:26"
Therein I need to replace / with / in order to get the string:
/
"04/Jun/2014:15:54:26".
"04/Jun/2014:15:54:26"
I tried tr as follows:
tr
echo "04Jun2014:15:54:26" | tr '' '\/'
But this results in: "04Jun2014:15:54:26".
"04Jun2014:15:54:26"
It does not satisfy me. Can anyone help?
No need to use an echo + a pipe + sed.
A simple substitution variable is enough and faster:
echo ${DATE////\/} #> 04/Jun/2014:15:54:26
1.4m articles
1.4m replys
5 comments
57.0k users