Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Generic questionwith cygwin path

by Anonymous Monk
on Mar 23, 2011 at 07:53 UTC ( [id://894958]=note: print w/replies, xml ) Need Help??


in reply to Generic questionwith cygwin path

Write a probram using Env @PATH and Filesys::CygwinPaths::fullwin32path

Replies are listed 'Best First'.
Re^2: Generic questionwith cygwin path
by Anonymous Monk on Mar 23, 2011 at 08:37 UTC
    Something like
    #!/usr/bin/perl -- use strict; use warnings; Main( @ARGV ); exit( 0 ); sub Main { print Plath( join ':', '.', '/usr/local/bin', '/mingw/bin', '/bin', '/c/WINDOWS/system32', '/c/WINDOWS', '/local/bin', '/mingw/bin', ),"\n"; print Plath( '.:/bin:/cygdrive/e/8660_qnx/1014/HY/data/install' ), +"\n"; } BEGIN { my $CygwinPaths = eval { require Filesys::CygwinPaths; 1; }; my $Stat = qx!stat.exe -c %n /!; sub Plath { my( $path ) = @_; my @path; for my $p ( split ':', $path ) { if( $CygwinPaths ){ push @path, Filesys::CygwinPaths::fullwin32path($p); } elsif( $Stat) { push @path, qx!stat -c %n $p!; } else { push @path, $p if $p =~ s!^/([a-z]{1,2})/!$1:/!; push @path, $p if $p =~ s!^/cygdrive/([a-z]{1,2})/!$1: +/!; } } return join ';', @path; } } __END__

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://894958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-19 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found