- Bash is a string oriented language
- We do not write
step=$((step++))this expression will return a numeric value which the shell will then take as the command to to be executed. - No spaces are allowed around the equal sign for variable assignment.
let "step++"is same as(( step++ ))- Use
declareto set variable values and attributes
In bash
= and == both mean the same thing💬 What is the difference between
[and[[?
- •
if cd $dir; then
In this case the command
cd $dirwill be executed and based on success or failure of the command executed the if or else part will be executed respectively.if [$dir]; then<span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"> <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#if-dir-then" aria-label="Anchor">#</a> </span>Single bracket is equivalent to test command evaluate conditional expression
- •
< & >
- Within
[compare using simple ASCII ordering & within[[comparison is lexicographic. - Within
[you have to escape\>to avoid redirection.
- Within
- •
💬 BC is a language?
<span></span>
</span>
<span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden">
<span class="relative block icon"><svg
xmlns=“http://www.w3.org/2000/svg"
viewBox=“0 0 20 20”
fill=“currentColor”
aria-hidden=“true”
<span></span>
</span>
<span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden">
<span class="relative block icon"><svg
💬 Supports arbitrary precision numbers with interactive execution of statements. (Command line)
awk provides filtering capabilities
> printf 'gate\napple\nwhat\nkite\n' | awk '/at/'
gate
whatprintf 'gate\napple\nwhat\nkite\n' | awk '!/e/'
whatawk is primarily used for field based processing
One liner structure awk 'cond1{action1} cond2{action2} … condN{actionN}'

