add file-gen.sh

This commit is contained in:
kcubeterm 2020-11-18 16:42:17 +00:00
parent 78eb446f79
commit ef9c6e68a3
1 changed files with 22 additions and 0 deletions

22
file-gen.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Use this script for format generator, theres thousand of file in db directory created with script.
# Usage
# ./file-gen.sh packagename/regrex
# eg. ./file-gen.sh g # it will generate file of all packages starting with "g"
alpha="$@"
apt install "${alpha}*" -y
pp=`apt list "${alpha}*" | cut -d'/' -f1`
for i in $pp;
do
echo $i
dpkg -L $i >> $i.raw
echo " Raw file has created"
sed "s/^/$i: /" $i.raw >> $i
apt remove $i -y
done
rm *.raw