I prefer to use *.sh files.
I would advise to launch something like my script below for better understanding. You will see how each line had had worked.
#!/bin/bash
set -x
read -p 'Enter swap size in megabytes: ' size_mb
size_kb=$((1024*${size_mb}))
dd if=/dev/zero of=/swap bs=1024...
Thanks to set -x, we can see every action that the script performs. It starts with + character, and then the standard output is visible after this action. This makes it easier to debug the bash script, because all the variables are visible in the commands. And it can help a lot, when your...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.