Sonsivri

Computers => Internet Scripting Languages => Topic started by: sphinx on March 04, 2023, 04:24:38 16:24



Title: a question about speeding up a script in linux
Post by: sphinx on March 04, 2023, 04:24:38 16:24
sorry might not be the right place to ask

i have made a short/small bash script in linux(debian sid) which i am using to update my collection of "deb" files i like to be on hand
i am wondering if there is a way/ways to speed it up

#START
#!/bin/sh

# get list of DEB packages in folder sort them and delete duplicates
debdata=`ls /var/cache/apt/archives | cut -d"_" -f1 | sort | uniq -u`

# get each package from debdata
for debpackage in $debdata ; do
    # print on screen
    echo $debpackage
    # only download package quietly no install
    apt-get -y -d -qq reinstall $debpackage
done
# END