Greg Donald : bash Tag

Automate Linux Kernel Builds

I wrote a small shell scriptâ„¢ to automate building new Linux Kernels. I use this to build new kernels on my Debian systems:

#!/usr/bin/env bash

WORKSPACE='/home/gd/workspace'
LINUX="${WORKSPACE}/linux"

find "${WORKSPACE}" -type f \( -name 'linux-*deb' -o -name 'linux-upstream*' \) -mtime -3 -exec rm {} \;

linux (9) kernel (5) bash (3)

How to filter out Bash arguments

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

bash (3)

My bashrc file

alias ls='ls -ah --color=always' alias ll='ls -lavh --color=always' alias cp='cp -i' alias vi='/usr/bin/emacs' alias ..='cd ..' alias ...='cd ../..'

bash (3)