September 28, 2014
I don't play the lottery but I find random number generators and the Linux Kernel interesting so I wrote a simple Linux Kernel module that does a PowerballTM "quick pick". You can download it from GitHub: https://github.com/gdonald/linux-kernel-powerball-module
Read More...
linux (10) kernel (5) lottery (1) powerball (1) module (1)
September 22, 2014
Ever want to know how to drop an argument (and value), --dir in this case, from a Bash script? Someone from my local LUG asked how to do it and this is what I came up with: Fun ;) #!/usr/bin/env bash args=("$@") myargs=() nextarg=-1 for ((i=0; i<$#; i++)) { if [ $nextarg == $i ]; then continue; fi case ${args[$i]} in --dir) nextarg=$((i+1)) ;; *) myargs+="${args[$i]} " esac } echo $myargs ./remove_dir.bash --dir foo --bar baz --bar baz
Read More...
bash (3)