diff --git a/.local/bin/bibinput b/.local/bin/bibinput index 31acb90..4d0be9d 100755 --- a/.local/bin/bibinput +++ b/.local/bin/bibinput @@ -12,11 +12,11 @@ parse(){ if [ "$1" = "@" ]; then - cat "$file" | grep "$1" | awk -F '{' '{print $2} ' | tr ',' '\n' | sort -r | sed '/^[[:space:]]*$/d' + grep "$1" "$file" | awk -F '{' '{print $2} ' | tr ',' '\n' | sort -r | sed '/^[[:space:]]*$/d' elif [ "$1" = "keywords" ]; then - cat "$file" | grep "$1" | awk -F '"' '{print $2} ' | tr ' ' '\n' | sed 's/,//g' | sort -u | sed '/^[[:space:]]*$/d' + grep "$1" "$file" | awk -F '"' '{print $2} ' | tr ' ' '\n' | sed 's/,//g' | sort -u | sed '/^[[:space:]]*$/d' else - cat "$file" | grep "$1" | sed "s/,$//g" | awk -F '"' '{print $2} ' | sort | uniq + grep "$1" "$file" | sed "s/,$//g" | awk -F '"' '{print $2} ' | sort | uniq fi } @@ -25,7 +25,7 @@ input() { if [ "$1" = "reference" ]; then refinput | dmenu -i -p 'reference?' -l 10 elif [ "$1" = "doctype" ]; then - printf "$doctypes" | sed "s| |\n|g" | dmenu -i -p 'doctype?' + echo "$doctypes" | sed "s| |\n|g" | dmenu -i -p 'doctype?' elif [ "$1" = "author" ]; then parse "author" | dmenu -i -p 'author name? (surname, first name)' -l 10 elif [ "$1" = "keywords" ]; then diff --git a/.local/bin/bibshow b/.local/bin/bibshow index 68184c1..ac4d113 100755 --- a/.local/bin/bibshow +++ b/.local/bin/bibshow @@ -12,7 +12,7 @@ file="$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibshow] which bibliography?")" # the -not -path allows find to ignore hidden files -refs_list="$(cat "$file" | sed 's/\t//g' | tr '\n' ' ' | sed 's/}\ /}\n/g')" +refs_list="$(sed 's/\t//g' "$file" | tr '\n' ' ' | sed 's/}\ /}\n/g')" [ -z $refs_list ] && exit 1; ref="$(echo "$refs_list" | dmenu -i -p 'infos?' -l 10)" diff --git a/.local/bin/compiler b/.local/bin/compiler index 0a8a4f9..1b91ffc 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -32,7 +32,7 @@ shebangtest() } texcompile() { \ - bibliography="$(cat "$file" | grep '\bibliography')" + bibliography="$(grep '\bibliography' "$file")" if [ -n "$bibliography" ]; then pdflatex --output-directory="$dir" "$base" && bibtex "$base" &&