forward slashes

Help
mauri3008
2007-08-14
2013-04-24
  • mauri3008
    mauri3008
    2007-08-14

    Can anybody help me?
    In win2k I'm trying to use basename.exe but i must use the reverse slash and not the slash in windows style:

    W:\>basename c:\temp\prova.bat
    c:\temp\prova.bat                               <=========== doesn't work

    W:\&gt;basename c:/temp/prova.bat                  <=========== ok
    prova.bat

    Thanks.

     
    • Jason Anderson
      Jason Anderson
      2007-09-29

      How about this workaround?

      Z:\&gt;echo c:\temp\ppm4.log | sed -e s/.*\\\(.*\)$/\1/
      ppm4.log

       
    • Or, for the Windows NT cmd.exe flavour:

      set MYPATH=c:\foo\bar
      basename %MYPATH:\=/%