Tag Info

Hot answers tagged

5

Do you understand the argument list?  For example, if you type ls -l foo bar, the shell executes /bin/ls with an argument list consisting of four strings: ls -l foo bar whereas, if you type ls -l "foo bar" (or ls -l 'foo bar' or ls -l foo\ bar), the shell executes /bin/ls with an argument list consisting of three strings: ls -l foo bar and ls -l * might ...


2

reg add "HKCR\Applications\myapp.exe\shell\open\command" /ve /t REG_EXPAND_SZ /d "\"^%MYAPPSDIR^%\myapp.exe\" \"^%1\"" /f Note: to avoid expanding %MYAPPSDIR% by command line interpreter, % percent character should be escaped by the standard CLI escape character (^ caret): ^%MYAPPSDIR^%; to include a quote mark " in the data, prefix it with the reg ...


2

getenv is part of the Standard C Library. So, in C you would need to include stdlib.h.


2

It's a function in the Standard C Library. Source getenv(3) - Linux man page Name getenv, secure_getenv - get an environment variable Synopsis #include <stdlib.h> char *getenv(const char *name); char *secure_getenv(const char *name); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): secure_getenv(): ...


1

Just tried and it worked fine. Windows is slightly different as its shortcut has a default hidden "lnk" extension. So if you create a shortcut for "myprogram.exe", you need to rename the file to "myprogram" in Explorer, you can then invoke it using "myprogram" or "myprogram.lnk" from RUN dialog, or "myprogram.lnk" from command prompt. Or you can create a ...


1

If you run your script with -x (both bash and zsh) you will see that the $(...) code gets interpreted/parsed differently. This is because, as stated in the FAQ, word splitting in zsh is backwards/bash/sh incompatible. You can use SH_WORD_SPLIT to address this difference. Ok, so it is not a word split problem as we have a command substitution, quoting the ...



Only top voted, non community-wiki answers of a minimum length are eligible