See in utils/ and current.sh (deprecated) in slackutils