msys path conversion (or cygpath for msys?)

前端 未结 7 2209
心在旅途
心在旅途 2020-12-02 17:15

I need to pass /DEF:c:\\filepath\\myLib.def\" command line option from a bash script to MS compiler/linker. The path is generated as part of build process by a bash script.

7条回答
  •  余生分开走
    2020-12-02 17:44

    My bash foo is weak and I couldn't get regexes working in bash 3.1 so I hacked out a perl script for it:

    #!/bin/env perl
    use strict;
    
    my @r;
    foreach my $e (@ARGV) {
     $e=~s/\//\\/g;
     $e=~s/^\\([A-Za-z])\\/\1:\\/;
     push @r, $e;
    }
    
    print join(" ", @r);
    

提交回复
热议问题