I want to replace . with / in a Unix shell script:
2015.07.25 to 2015/07/25
How can I do this?
You can use sed this says substituted for the characters in the site [.] (which is just the '.' char) a forward slash. The g at the end stands for "make this a global substitution, not just replace the first instance.
echo "2015.07.25" | sed 's;[.];/;g'
Result:
$ echo "2015.07.25" | sed 's;[.];/;g'
2015/07/25
echo "2015.07.25". OR once your value is assigned to a variable, i.e.myDate="2015.07.25". Please take 15 mins to read what you can when searching for[unix] date reformat, sorted by highest votes, and then update your question to make something answerable. Good luck.