Skip to content

How to simplify the comparison in the bash?

how to make several comparisons in the bash by placing the condition and comparison points next to instead of the long queue ? that something like this before : after (what I want): Answer Try this using bash regex with the keywork =~: Edit : As seen in comments, for real you need to compare int, not strings,…

How to use environment variables in a .service script

I have an elixir project on a linux server. I have created a .service script which will start and stop the application with the following commands The .service file looks something like this… It works as expected, the one exception being that it will not read the environment variables. I can give the ap…

Grep Regex: How to find multiple area codes in phone number?

I have a file: each line consist of a name, room number, house address, phone number. I want to search for the lines that have the area codes of either 404 or 202. I did “(404)|(202)” but it also gives me lines that had the numbers in the phone number in general instead of from area code, example:…

Convert column to matrix format using awk

I have a gridded data file in column format as: I would like to convert it to matrix format as: Where top 20.5 21.5 22.5 indicate y and side values indicate x and the inside values indicate the corresponding grid values. I found a similar question here Convert a 3 column file to matrix format but the script i…

Kate Editor Reset Settings

How can I reset the changings, i have done in Kate on a non KDE desktop? In Settings under Configure Kate in Fonts & Colors i mistakenly changed Vim(dark) to “Use KDE Colour Scheme” The Problem is, that it overwrote Vim. Answer A Kate developer here: There is no option for that in the user int…