Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PATHEXT for Bash?

Name: Anonymous 2006-05-25 7:16

Is there any kind of PATHEXT for Bash?

PATHEXT, a feature of CMD.EXE and the Windows shell API, is like PATH for file extensions. If, for example, you set it to ".EXE;.PL", and launch "lol", for each directory in PATH, it will try to find "lol" as is, then "lol.EXE", then "lol.PL". Windows will start the first file found.

Start means it'll look for the default shell action and do it. If it's a Perl file, it'll run it through Perl. If it's an executable, it'll directly execute it. This avoids having to do the #!/lol_my_folder_is_different/perl shit in scripts) and allows you to launch anything associated with any command. I don't expect this to be possible under Lunix because you have no global file associations, but would at least there be a PATHEXT equivalent?

Name: Anonymous 2006-05-25 10:02

>>4 have you herd of a command named "file"?  tells you the filetype.

continuing from >>6, really, if you like this capability, you can build a lot of effective features in that script.  furthermore, you probably want to use the file command rather than checking "extensions", even though that will require some string manipulation ... and you can define/use whatever environment variables you want.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List