HI!
I would like to use this simple script.sh:
#!/bin/sh
filename=$1
echo $filename | sed 's/\([A-Z]\)/ \1/g';
In a script.bat, but my computer is not Windows, so I can’t test it. This one would be correct??
prueba.bat
filename=%1
echo %filename% | sed 's/\([A-Z]\)/ \1/g';
Thanks in advance
Not quite:
But you do have to make sure you have a
sedavailable (CygWin or GnuWin32 are excellent for these tools – I prefer GnuWin32 if you only need specific things, CygWin tends to give you a lot).You also have to be careful with environment variables like
filename. While UNIX will create them in the context of the current shell (so its effect will be limited),cmd.exescripts will “leak” them (hence the direct use of%1).