I want to be able to log result of running bash script to file. Script itself is pretty simple, its used to install basic packages on fresh install machines and it scheme looks like this
sudo apt-get install -y nano
The thing im trying to achieve is the bash script to report whether installation went smoothly or in case it didnt success - to point what went wrong. So I would like it to create file like "log" which would very briefly report status, for example
Package "nano" successfully installed!
Package "nano" failed to install. // Here comes the line of apt-get install that caused fail
Thanks in advance!