What does $# mean in shell? - Unix & Linux Stack Exchange
What does $# mean in shell? I have code such as if [ $# -eq 0 ] then I want to understand what $# means, but Google search is very bad for searching these kinds of things.
What is the meaning of $? in a shell script? - Unix & Linux Stack …
Feb 20, 2011 · When going through one shell script, I saw the term "$?". What is the significance of this term?
Difference between Login Shell and Non-Login Shell?
May 8, 2012 · I understand the basic difference between an interactive shell and a non-interactive shell. But what exactly differentiates a login shell from a non-login shell? Can you give …
shell - Safely save and restore environment variables - Unix & Linux …
Oct 26, 2023 · I have a script that parses a rudimentary .env file and exports its contents as environment variables, before taking further action: set -eu test -f .env && load_dotenv …
Shell script with getopt for short and long options -handling option ...
Aug 2, 2025 · When it comes to shell scripts it's difficult to support both short options and long options. I usually pick one or the other and use getopt or getopts as appropriate.
shell - Replace multiple spaces with one using 'tr' only - Unix
I have a file, f1.txt: ID Name 1 a 2 b 3 g 6 f The number of spaces is not fixed. What is the best way to replace all the white spaces with one space using only tr? ...
shell - What is the "eval" command in bash? - Unix & Linux Stack …
What can you do with the eval command? Why is it useful? Is it some kind of a built-in function in bash? There is no man page for it..
shell - Using `find` to find a file in PATH - Unix & Linux Stack …
Jul 30, 2025 · This [escaping a colon in PATH on UNIX] is impossible according to the POSIX standard. This is not a function of a specific shell, PATH handling is done within the execvp …
shell - What does `kill -0` do? - Unix & Linux Stack Exchange
See here if you're confused about the differences b/w Bash's trap command and 0 vs. a signal 0 from kill: What is signal 0 in a trap command?
shell - Understanding the -exec option of `find` - Unix & Linux Stack ...
Sep 1, 2017 · I find myself constantly looking up the syntax of find . -name "FILENAME" -exec rm {} \\; mainly because I don't see how exactly the -exec part works. What is the meaning of the …