Artificial intelligent assistant

Disowned command with redirected STDOUT/STDERR still sending output to shell I defined a function in my `.bashrc` that allows me to open e.g. pdf files from bash by running `copen myfile.pdf`: function copen { if [[ $# -eq 1 ]] ; then xdg-open "$1" > /dev/null 2>&1 & disown return 1 fi } By running this command, I execute e.g. Okular in the background, redirect STDOUT and STDERR to `/dev/null` and disown it from bash. However, after running `copen myfile.pdf` I still get output printed to bash (`QSqlQuery::exec: database not open` multiple times) and I don't understand why. How do I suppress that kind of output? _Note that the problem persists when changing the code to_ `nohup xdg-open "$1" > /dev/null 2>&1 &`.

Try this approach:


#!/usr/bin/bash

copen() {
(($# == 1)) && xdg-open "$1" &>/dev/null & disown
}
copen "$1"


Run the script as follows: `./myscript SomePDFfile.pdf`

The `&>/dev/null` is a shorthand for `>/dev/null 2>&1` added in bash >4.

The `copen` function needs a parameter.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy dd4b134f8a9bac6b586cadb797aacb74