skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
3k stars 211 forks source link

Tip: busybox-w32 shell option -d allows you to specify the current directory of the new shell #47

Open oboff opened 1 year ago

oboff commented 1 year ago

A helpful feature I just found:

busybox-w32 has an undocumented shell option -d which allows you to specify the current directory of the new shell. This has to appear before the -s or -c options.

Source: https://github.com/rmyorston/busybox-w32/issues/211#issuecomment-792578645

With ..\w64devkit\bin in your PATH you could do the following in Windows PowerShell or cmd :

> sh -d \path\to\working\folder

and get in your busybox-w32 session:

/path/to/working/folder $ 
rmyorston commented 1 year ago

Yes, but I've also written:

Ssssh! Don't tell everyone, that's supposed to be undocumented.

and

I won't be sending a patch for the new ash options to upstream BusyBox. They'll remain non-portable oddities in busybox-w32 (until I can find a way of removing them, just to inconvenience anyone who's unwise enough to use them.).

You Have Been Warned.