[bash]Update Packages

This is a script that allows to install packages from a folder, filtering to use only which are already installed

#!/bin/bash
# END
for e in $(ls -F | grep -v [/,*]) 
do
#we'll store in $filename the dpkg package name.
filename=$(echo $e | cut -d_ -f1)
dpkg -l | grep $filename > /dev/null

	if [ $? == 0 ] ; then

		sudo dpkg -i $e
	else 
		echo $filename "is not installed, ignored"
	fi
done

Deja un comentario