Ubuntu says “bash: ./program Permission denied” [closed]

chmod u+x program_name. Then execute it. If that does not work, copy the program from the USB device to a native volume on the system. Then chmod u+x program_name on the local copy and execute that. Unix and Unix-like systems generally will not execute a program unless it is marked with permission to execute. The … Read more

Where to place $PATH variable assertions in zsh?

tl;dr version: use ~/.zshrc And read the man page to understand the differences between: ~/.zshrc, ~/.zshenv and ~/.zprofile. Regarding my comment In my comment attached to the answer kev gave, I said: This seems to be incorrect – /etc/profile isn’t listed in any zsh documentation I can find. This turns out to be partially incorrect: … Read more

In the shell, what does ” 2>&1 ” mean?

File descriptor 1 is the standard output (stdout).File descriptor 2 is the standard error (stderr). Here is one way to remember this construct (although it is not entirely accurate): at first, 2>1 may look like a good way to redirect stderr to stdout. However, it will actually be interpreted as “redirect stderr to a file … Read more

How to execute a program or call a system command?

Use the subprocess module in the standard library: The advantage of subprocess.run over os.system is that it is more flexible (you can get the stdout, stderr, the “real” status code, better error handling, etc…). Even the documentation for os.system recommends using subprocess instead: The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function. See the Replacing Older Functions with … Read more

How do I split a string on a delimiter in Bash?

You can set the internal field separator (IFS) variable, and then let it parse into an array. When this happens in a command, then the assignment to IFS only takes place to that single command’s environment (to read ). It then parses the input according to the IFS variable value into an array, which we … Read more

“No such file or directory” but it exists

This error can mean that ./arm-mingw32ce-g++ doesn’t exist (but it does), or that it exists and is a dynamically linked executable recognized by the kernel but whose dynamic loader is not available. You can see what dynamic loader is required by running ldd /arm-mingw32ce-g++; anything marked not found is the dynamic loader or a library that you need to install. … Read more

Meaning of “! -S” in shell script

The command you are looking at is actually this: Although it looks like punctuation, [ is actually the name of a command, also called test; so the command can also be written like this: Which in context would look like this: As the name suggests, its job is to test some attribute of a string, … Read more