Shell Script Best Practices
export HISTTIMEFORMAT='%F %T '
history
partage d'écran via DWService
partage de terminal via tmate
printf "%04d"
super article sur le scripting shell
des tonnes d'info en + dans les commentaires
Web based shell access using PHP file
Access Linux Shell from a Browser
1) Create/identify a tar.gz file that you wish to become self extracting.
2) Create the self extracting script. A sample script is shown below:
cat extract.sh
!/bin/bash
echo "Extracting file into
pwd"searches for the line number where finish the script and start the tar.gz
SKIP=
awk '/^__TARFILE_FOLLOWS__/ { print NR + 1; exit 0; }' $0
#remember our file name
THIS=pwd/$0take the tarfile and pipe it into tar
tail -n +$SKIP $THIS | tar -xz
Any script here will happen after the tar file extract.
echo "Finished"
exit 0NOTE: Don't place any newline characters after the last line below.
__TARFILE_FOLLOWS__
3) Concatenate The script and the tar file together.
cat extract.sh example.tar.gz > example.sh
chmod +x example.sh
4) Now test in another directory.
cp example.sh /tmp
cd /tmp