BASH PROGRAM EXPORTER SCRIPT
Page 1 of 1
BASH PROGRAM EXPORTER SCRIPT
VID
Export Program Script (c) J~Net 2021
jnet.sytes.net
This script will copy the program if the program exists. (To current folder).
If it does not exist it will attempt to install it!
Example Usage:
Code
Export Program Script (c) J~Net 2021
jnet.sytes.net
This script will copy the program if the program exists. (To current folder).
If it does not exist it will attempt to install it!
Example Usage:
- Code:
./export.sh gobuster
Code
- Code:
#!/bin/bash
# (c) J~Net 2021
# jnet.sytes.net
#
# https://jnet.forumotion.com/t1736-bash-program-exporter-script#2687
#
# ./export gobuster
#
program="$1"
dir=`pwd`
installed=`which $program`
echo "Checking For $program (Check 1 of 2)"
FILE=$installed
if [ -f "$FILE" ]; then
echo "$FILE Exists."
else
sudo apt install -y $program
fi
echo "Checking For $program (Check 2 of 2)"
if [[ $installed ]]
then
echo "$installed Installed"
sudo cp $installed $dir
echo "Copyied to current folder"
else
echo "$program Not Installed"
sudo apt install -y $program
fi
Similar topics
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» Bash Database Program Record Storage App
» BASH Linux Talking IP Script
» Linux Bash Dog Age Calculator Script
» Convert MP4 To MP3 Linux Bash Script
» Bash Database Program Record Storage App
» BASH Linux Talking IP Script
» Linux Bash Dog Age Calculator Script
» Convert MP4 To MP3 Linux Bash Script
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum