Is there a way in Linux to make sudo command to remember the password the user entered for in the first of the lines?
For example, for a list of commands that the user has to enter, the some of then requiring a sudo prefix, how can one make sure that if the user copy+pastes the instructions into a terminal all in one go, is only asked the password once?
Example:
mkdir ~/acpiinfo ; cd ~/acpiinfo
sudo acpidump > acpidump.txt
# enter password
sudo acpixtract acpidump.txt
ls *.dat | while read i; do iasl -d "${i}"; done
pid=`sudo dmidecode -s system-product-name`
vid=`sudo dmidecode -s system-version`
name=$pid.$vid
mkdir "${name}" && cp *.dsl "${name}"/
tar czf "${name}.tar.gz" "${name}"/ && ls -l "$( pwd )/${name}".tar.gz