You are not logged in.
Hi, sorry for the super noob question
Why for some programs one should autostart the program with an & (e.g., conky &) while in some cases the & is not needed?
I know this may sound a silly question, but I would like to know what that & does and under which cases I should autostart a program by putting & at the end.
Thanks!
PS: couldn't find an answer on the web to this simple question...
Last edited by ap (2017-10-08 10:32:38)
Offline
Offline
I see....I am not a native English speaker and I didn't know the symbol is called ampersand. I was looking for 'and' and couldn't find anything while I see there are a few explanations when searching for 'ampersand'...so if I understand right, ampersand allows to execute a process in the background...but practically what's the difference then between a 'conky &' and 'conky' and why it is preferred to run it in a way compared to the other? thanks
Offline
Ampersand will drop it to background, so the script may continue (not all need that, there was a thread about that).
You can probably test in cli with
program && echo "hi"
If there is hi, then it probably doesn't need &.
Last edited by brontosaurusrex (2017-10-08 09:48:11)
Online
I know this may sound a silly question, but I would like to know what that & does and under which cases I should autostart a program by putting & at the end.
It is an excellent question
My simple test is to run the given command from a terminal and if it returns the prompt then an ampersand should *not* be used.
BunsenLabs changed the openbox autostart script to remove superfluous ampersands (and their associated `sleep`s) because we noticed conflicts could occur otherwise.
Offline
Thanks guys,always very helpful and kind Now it's very clear and I understand the use of ampersand in autostarting a program. I'll mark this as solved.
Offline
The etymology is interesting for ampersand & and etc etc...
Offline