Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/7704/what…
What is the meaning of $? in a shell script? - Unix & Linux Stack Exchange
When going through one shell script, I saw the term "$?". What is the significance of this term?
Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/109625/sh…
Shell scripting: -z and -n options with if - Unix & Linux Stack Exchange
You can find a very nice reference for bash's [ aka test builtin's operators here, or by running help test in a bash shell or info bash test or info bash '[' from any shell¹. If you are using a different shell, just search for the description of its [ or test builtin in its documentation of if it doesn't have such a builtin², in the man page of the standalone test utility³ and you will find ...
Global web icon
superuser.com
https://superuser.com/questions/935374/difference-…
Difference between ${} and $() in a shell script - Super User
Difference between $ {} and $ () in a shell script Ask Question Asked 10 years, 5 months ago Modified 10 months ago
Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/122343/wh…
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.
Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/453502/wh…
What does -f mean in an if statement in a bash script?
The relevant man page to check for this is that of the shell itself, bash, because -f is functionality that the shell provides, it's a bash built-in. On my system (CentOS 7), the fine man page covers it. The grep may not give the same results on other distributions. Nevertheless, if you run man bash and then search for '-f' it should give the results you require. $ man bash | grep -A1 '\-f ...
Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/554595/ho…
shell script - How to iterate a CSV file in bash? - Unix & Linux Stack ...
First of all, avoid doing text-parsing with shell loops. It is hard to do, easy to get wrong and very hard to read. And slow. Very, very, slow. Instead, use something like awk which is specifically designed to read by "fields". For example, with this input file: foo, bar, baz oof, rab, zab You can read each comma-separated field using awk -F, to set the field separator to ,: $ awk -F, '{ print ...
Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/16024/how…
How can I assign the output of a command to a shell variable?
A shell assignment is a single word, with no space after the equal sign. So what you wrote assigns an empty value to thefile; furthermore, since the assignment is grouped with a command, it makes thefile an environment variable and the assignment is local to that particular command, i.e. only the call to ls sees the assigned value. You want to capture the output of a command, so you need to ...
Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/23111/wha…
What is the "eval" command in bash? - Unix & Linux Stack Exchange
The shell executes a function, built-in, executable file, or script ... The shell optionally waits for the command to complete and collects the exit status. At step 6 a built-in will be executed. At step 6 eval causes the processed line to be sent back to step 1. It is the only condition under which the execution sequence goes back.
Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/88850/pre…
Precedence of the shell logical operators - Unix & Linux Stack Exchange
This has confused me a lot in trying to write shell script pipelines with different logic based on some test (e.g. exiting if a file doesn't exist vs continuing the pipeline).
Global web icon
stackexchange.com
https://unix.stackexchange.com/questions/47584/in-…
In a bash script, using the conditional "or" in an "if" statement
In a bash script, using the conditional "or" in an "if" statement Ask Question Asked 13 years, 3 months ago Modified 1 year ago