Skip to content

Tag: linux

How to make an autoinstall command script for Debian

So I was working on a project that need some libraries . so I decided to made an .sh script to just install all at once but I don’t know why it fails . I was searching about it , but just found how to create installer like .deb , etc here are the commands lines that I use install.sh

Delete logs that ended with date format

I created the following cli in order to delete the logs with date format that oldest then 500 min date format is: the cli that should removed the logs as we can see the logs still exists where I am wrong? Answer Your regex does not match the files. Change ‘.*.log.[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2,10}$&…

Scripting in linux

Why java -version gives empty string when executing in subprocess.Popen. Is there any alternative to get the exact text given by java -version command in Linux? Answer I think you are getting some error so capture the stderr from the process. Then try to print the error.

Exiting bash script without terminating ssh connection

I’m pretty new to bash scripting and I’m attempting to write a script that does some basic operations. I want to check certain conditions and if they are met, terminate the script. So for example, I want to check whether the zip of files was successful: What happens though is that the exit 1 signa…