This shows you the differences between two versions of the page.
| bash_scripting [2021/07/22 02:43] – created vissie | bash_scripting [2021/07/22 02:49] (current) – vissie | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| =====Ask for input===== | =====Ask for input===== | ||
| + | <sxh bash; gutter: false> | ||
| + | #!/bin/bash | ||
| echo Hello, who am I talking to? | echo Hello, who am I talking to? | ||
| read varname | read varname | ||
| + | echo It\'s nice to meet you $varname | ||
| + | </ | ||
| + | |||
| + | =====Check if file does not exist===== | ||
| + | <sxh bash; gutter: false> | ||
| + | #!/bin/bash | ||
| + | FILE=/ | ||
| + | if [ ! -f " | ||
| + | echo "$FILE does not exist." | ||
| + | fi | ||
| + | </ | ||
| + | |||