Hi, I'm not a sed wizard but is something wrong with the sed output bellow:
$ sed --version
GNU sed version 4.1.4
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
$ echo "bug:me" | sed 's/[:]/ /'
bug me
$ echo "bug:me" | sed 's/:/ /'
C:\msys\local\bin\sed.exe: -e expression #1, char 13: unknown option to `s'
$ echo "bug:me" | sed 's/\:/ /'
C:\msys\local\bin\sed.exe: -e expression #1, char 9: unknown option to `s'
$ echo "bug:me" | sed 's+:+ +'
bug me
$ echo "bug:me" | sed 's+\:+ +'
bug me
I sent bug report to maintainer but he said to report it to gnuwin32...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BTW, I'm using the Windows command prompt (cmd.exe), whereas you use Bash. Perhaps that makes the difference. Or perhaps your sed.exe is not the GnuWin32 one, or not the latest build.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm not a sed wizard but is something wrong with the sed output bellow:
$ sed --version
GNU sed version 4.1.4
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
$ echo "bug:me" | sed 's/[:]/ /'
bug me
$ echo "bug:me" | sed 's/:/ /'
C:\msys\local\bin\sed.exe: -e expression #1, char 13: unknown option to `s'
$ echo "bug:me" | sed 's/\:/ /'
C:\msys\local\bin\sed.exe: -e expression #1, char 9: unknown option to `s'
$ echo "bug:me" | sed 's+:+ +'
bug me
$ echo "bug:me" | sed 's+\:+ +'
bug me
I sent bug report to maintainer but he said to report it to gnuwin32...
you are right it's some bash thing...
Use double quotes (") instead of single quotes (') in the sed edit command:
echo "bug:me" | sed "s/[:]/ /"
See the section Filename globbing and quoted arguments on
http://gnuwin32.sourceforge.net/install.html
If someone thinks it's quote problem - could you please post output of the commands in the first post with double quotes?
Here is mine...
$ echo "bug:me" | gnused.exe "s/\:/ /"
C:\msys\local\bin\gnused.exe: -e expression #1, char 9: unknown option to `s'
$ echo "bug:me" | gnused.exe "s/:/ /"
C:\msys\local\bin\gnused.exe: -e expression #1, char 13: unknown option to `s'
Thanks
The output of
echo "bug:me" | sed.exe "s/\:/ /"
is
"bug me"
BTW, I'm using the Windows command prompt (cmd.exe), whereas you use Bash. Perhaps that makes the difference. Or perhaps your sed.exe is not the GnuWin32 one, or not the latest build.