Square brackets and curly brackets in expressions?
#6
Code: (Select All)
TODELETE=$(( (DISKSIZE - 10000)/1000 ))

This is actually in one of the Bash scripts I use on Linux, which I obtained from one of the member sites of "Stackexchange-dot-com". The double-parenthesis on the outside are absolutely required to do math evaluations in an "ancient" terminal being given too many "modern" features.

The script was to create a large useless file only with ASCII0 in it, to then erase it, to then create a compressed image of the entire disk that Linux was installed into. Good for distro-hoppers like me LOL. This was the original source:

https://unix.stackexchange.com/a/584898
Reply


Messages In This Thread
RE: Square brackets and curly brackets in expressions? - by mnrvovrfc - 02-13-2023, 10:22 PM



Users browsing this thread: 1 Guest(s)