Checked scripts for syntax errors using shellcheck.

This commit is contained in:
2018-01-27 00:29:31 -06:00
parent e18ef374c4
commit 8a4c5fd6d7
5 changed files with 66 additions and 62 deletions

View File

@@ -0,0 +1,13 @@
#!/usr/bin/bash
function main() {
apt list --installed > temp.txt
echo "aptitude" >> temp.txt ## Apend aptitude to list
lineCount=$(wc -l temp.txt | awk '{printf $1}') ## Get line count minus one to remove first line
tail -n$((lineCount - 1)) temp.txt > cleanedList.sh ## Get all lines but the first
echo "aptitude markauto ~i \\ " > temp.txt
awk '{ FS = "/"} NF{printf " !~" $1}' cleanedList.sh >> temp.txt
rm cleanedList.sh
mv temp.txt cleanedList.sh
}
main;