ffr (645B)
1 #!/bin/sh 2 CONFIG_FILE="$HOME/.config/ffr" 3 4 if [ $# -eq 0 ]; then 5 sed '/^#>/Q' "$CONFIG_FILE" 6 else 7 section="$1" 8 awk -v section="$section" ' 9 /^#>/ && 10 section_notes { section_notes = 0 } /^#>/ && 11 (" " $0 " " ~ " #>" section " ") { section_notes = 1; next } 12 section_notes { print } 13 ' "$CONFIG_FILE" 14 fi 15 16 # example below of an ~/.config/ffr file, pound signs followed by a space need to be removed 17 18 # tar -czvf archive.tar.gz thing/ file 19 # : this command will print out when 'ffr' is ran without arguments 20 # #>ffmpeg #>ffm #>peg 21 # this line is printed when 'ffr ffmpeg', 'ffr ffm', or 'ffr peg' is ran 22 # : additional notes