Skip to content

Tag: bash

Change exit code on a single line using Bash?

I am using the savscan command but this returns 3 instead of 1 when a malware is detected, and I need to get 1 if a malware is detected, I tried the following: but I still get the exit code 0, I also need to run everything in one line Answer Personally, I’d use a function wrapper for this: …as

zipping all files specified in a text file and then deleting them

I’m trying to add each file, specified one per line, into a file named files.zip. The directory structure of each file specified should remain as is. After the file listed in files.txt is added to files.zip it should be deleted, but never the directories. The structure of the text file is one file per l…

Makefile generate numerical list of files

I have a Makefile that I use for building a book I am writing into EPUB and Kindle formats. However, my list of source files is getting really long: I am trying to generate this list programmatically, and I got it working with: But can’t help but feel I feel like there is a simpler way. Is there a simpl…

Assigning colors to HTML table columns based on conditions

I am using a bash script to send an email in html table format. I have a command like below. Columns are: scenario: When counts are matching then count_validation column will have ‘Matching’ with green color background else red color background. Same way for amounts. What am I missing or doing wro…