Bash Scripting

30 commands

#!/usr/bin/env bash#!/bin/bashVAR='hello'echo $VARecho "Value is: $VAR"arr=(one two three)echo ${arr[1]}echo ${arr[@]}echo ${#arr[@]}for i in ${arr[@]}; do echo $i; donefor i in $(seq 1 10); do echo $i; donefor file in *.txt; do echo $file; donewhile read line; do echo $line; done < file.txtwhile true; do command; sleep 5; doneif [ condition ]; then ... fiif [[ $VAR == 'value' ]]; then ... fiif [[ -f file.txt ]]; then ... fiif [[ -d dir/ ]]; then ... fiif [[ -z $VAR ]]; then ... fiif [[ -n $VAR ]]; then ... fiif [[ $NUM -gt 10 ]]; then ... ficase $VAR in val1) cmd1 ;; val2) cmd2 ;; *) default ;; esacfunction greet() { echo "Hello, $1"; }greet AliceRESULT=$(command)NUM=$(( 5 + 3 ))echo $(( 10 % 3 ))[ -r file ] && echo 'readable'command || echo 'command failed'set -euo pipefail
Search all 7,657 commands instead.