Questions tagged as ['redirect']
This hides output from the first command, and prints Oops
to stderr if it fails. So far, so good.
#!/usr/bin/env bash
invalid_command > /dev/null 2>&1 || >&2 echo "Oops"
echo hi
That outputs this:
Oops
hi
But I need to exit as well as printing a message if the first command failed. So I tried using parenthesis.
#!/usr/bin/env bash
invalid_command > /dev/null 2>&1 || ( > ...
So, my question is: Why doesn't postfix simply use /etc/aliases to redirect incoming mail to external email addresses like I'm used to when I used ubuntu 16.04LTS?
Follow up question: Is there a simpler way to use /etc/postfix/virtual that I'm missing?
I have a new server and the email handling doesn't work the way I'm used to. I've spent most of the day scouring tutorials and manuals, but am still ...

I have 2 domains reditected (using A record) to one IP where Ubuntu server lives. All incoming requests go to running Spring Boot on port 80 (which works now). But I would like to run 2 Spring Boot apps. The first one for request using domain1.com and the second for requests using domain2.com.
Any ideas?

I want to create an alias to append a dated note to a file. (The use case I want to reproduce : Sebastian Daschner - How to do effective note taking as developer.
So far I was able to append the date, but I cannot figure out a way to append both the date and the note from user input.
Usage
append-to-file 'my text'
Expected result in file.txt
2021-08-30 : some previous text
2021-09-01 : my text
...