I need help to create a custom Linux command. I cannot get bash to recognize my script and its arguments.
This command needs to fulfill these requirements:
- Expect root privileges.
- Expect arguments.
- Preferably be written in Python 3.
The goal of this command is to install/remove software from both Ubuntu and Snap repositories (favoring snap repos) and upgrade said packages/snaps. Any help is appreciated.
Here is the code I have so far:
# import needed modules
import os
#create a list for input
inlist = []
#read input
A = input()
# break each word
inlist = A.split()
app = inlist[2]
#install software
if inlist[1] == 'install':
#try to install snap
os.system('sudo snap install '+app'
#try to install with apt-get
#remove software
#try to remove snap
#use try except block
#try to install wihout paying
#except to install with paying
#try to remove with apt-get
#find software
#try to find snap
#try to find with apt-get
#test package or snap
#autoremove
#upgrade
#install .deb
#run software