#TIL : Internal Variables in BASH

Aug 6, 2018 4 mins read 8d4302659

Internal Variables in BASH


Your current working directory, so you don’t have to use CWD=$(pwd)


Your previous working directory

Note : You can jump directly to it by the command cd -


The number of seconds the script has been running

You can use it for profiling or limiting timeout

while [ $(($SECONDS - START)) -le "$TIME_LIMIT" ]
	## Your work here

echo "It takes $SECONDS seconds to get here !"


Get random integer number, for getting random name or just roll a dice ;)

lucky boy

comments powered by Disqus