Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xuyuji9000/d5ce33a5acd5c66cc04aebfcc681fafc to your computer and use it in GitHub Desktop.
Save xuyuji9000/d5ce33a5acd5c66cc04aebfcc681fafc to your computer and use it in GitHub Desktop.
# This shell file used for practice the learning from the following link:
# - https://blog.dnmfarrell.com/post/bash-function-names-can-be-almost-anything/
function ++ { (( $1++ )); }
a=1
++ a
echo $a
@xuyuji9000
Copy link
Author

xuyuji9000 commented Jul 12, 2021

This snippet demonstrate the usage of arithmetic in bash.

#!/bin/bash
a=1
(( a++ ))
echo $a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment