MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/6l9t9/best_background_music_for_programming/c0469dl/
r/programming • u/[deleted] • May 29 '08
985 comments sorted by
View all comments
Show parent comment
3
&& only executes the second command if the first is successful. However, since the first & sends the command to the background, it is always taken to be successful.
1 u/jaggederest Sep 20 '08 edited Sep 20 '08 Yep, in this case, what's successful is the act of setting the previous command to run in background.thread.new(first_command) && second_commandessentially. 1 u/raldi Sep 20 '08 Not in my testing.. if you say:$ asdf & echo hiThe first command won't successfully start, but the second will print anyway.Have you seen otherwise, and in what shell? 1 u/jaggederest Sep 20 '08 hmm, interesting, maybe it just spawns it regardless, and is backgrounded before it attempts the command. 1 u/[deleted] Sep 20 '08 edited Sep 21 '08 the first will be in the background, you won't see the output. the second will print immediately as it won't wait for the output of the first.bash. 1 u/raldi Sep 21 '08 By "asdf" i meant, "a command which doesn't exist". So it won't start or go to the background. 1 u/[deleted] Sep 21 '08 edited Sep 21 '08 ..... well of course not. It's not a goddamn command. I figured "asdf" meant "random script or app here". 1 u/raldi Sep 21 '08 The comment i was replying to said, "In this case, what's successful is the act of setting the previous command to run in background."I'm pointing out that, no, the act of setting the previous command to run in the background is not necessarily successful. 1 u/[deleted] Sep 21 '08 But the previous command wasn't a command in your example. Of course that would never be successful.
1
Yep, in this case, what's successful is the act of setting the previous command to run in background.
thread.new(first_command) && second_command
essentially.
1 u/raldi Sep 20 '08 Not in my testing.. if you say:$ asdf & echo hiThe first command won't successfully start, but the second will print anyway.Have you seen otherwise, and in what shell? 1 u/jaggederest Sep 20 '08 hmm, interesting, maybe it just spawns it regardless, and is backgrounded before it attempts the command. 1 u/[deleted] Sep 20 '08 edited Sep 21 '08 the first will be in the background, you won't see the output. the second will print immediately as it won't wait for the output of the first.bash. 1 u/raldi Sep 21 '08 By "asdf" i meant, "a command which doesn't exist". So it won't start or go to the background. 1 u/[deleted] Sep 21 '08 edited Sep 21 '08 ..... well of course not. It's not a goddamn command. I figured "asdf" meant "random script or app here". 1 u/raldi Sep 21 '08 The comment i was replying to said, "In this case, what's successful is the act of setting the previous command to run in background."I'm pointing out that, no, the act of setting the previous command to run in the background is not necessarily successful. 1 u/[deleted] Sep 21 '08 But the previous command wasn't a command in your example. Of course that would never be successful.
Not in my testing.. if you say:
$ asdf & echo hi
The first command won't successfully start, but the second will print anyway.
Have you seen otherwise, and in what shell?
1 u/jaggederest Sep 20 '08 hmm, interesting, maybe it just spawns it regardless, and is backgrounded before it attempts the command. 1 u/[deleted] Sep 20 '08 edited Sep 21 '08 the first will be in the background, you won't see the output. the second will print immediately as it won't wait for the output of the first.bash. 1 u/raldi Sep 21 '08 By "asdf" i meant, "a command which doesn't exist". So it won't start or go to the background. 1 u/[deleted] Sep 21 '08 edited Sep 21 '08 ..... well of course not. It's not a goddamn command. I figured "asdf" meant "random script or app here". 1 u/raldi Sep 21 '08 The comment i was replying to said, "In this case, what's successful is the act of setting the previous command to run in background."I'm pointing out that, no, the act of setting the previous command to run in the background is not necessarily successful. 1 u/[deleted] Sep 21 '08 But the previous command wasn't a command in your example. Of course that would never be successful.
hmm, interesting, maybe it just spawns it regardless, and is backgrounded before it attempts the command.
the first will be in the background, you won't see the output. the second will print immediately as it won't wait for the output of the first.
bash.
1 u/raldi Sep 21 '08 By "asdf" i meant, "a command which doesn't exist". So it won't start or go to the background. 1 u/[deleted] Sep 21 '08 edited Sep 21 '08 ..... well of course not. It's not a goddamn command. I figured "asdf" meant "random script or app here". 1 u/raldi Sep 21 '08 The comment i was replying to said, "In this case, what's successful is the act of setting the previous command to run in background."I'm pointing out that, no, the act of setting the previous command to run in the background is not necessarily successful. 1 u/[deleted] Sep 21 '08 But the previous command wasn't a command in your example. Of course that would never be successful.
By "asdf" i meant, "a command which doesn't exist". So it won't start or go to the background.
1 u/[deleted] Sep 21 '08 edited Sep 21 '08 ..... well of course not. It's not a goddamn command. I figured "asdf" meant "random script or app here". 1 u/raldi Sep 21 '08 The comment i was replying to said, "In this case, what's successful is the act of setting the previous command to run in background."I'm pointing out that, no, the act of setting the previous command to run in the background is not necessarily successful. 1 u/[deleted] Sep 21 '08 But the previous command wasn't a command in your example. Of course that would never be successful.
..... well of course not. It's not a goddamn command. I figured "asdf" meant "random script or app here".
1 u/raldi Sep 21 '08 The comment i was replying to said, "In this case, what's successful is the act of setting the previous command to run in background."I'm pointing out that, no, the act of setting the previous command to run in the background is not necessarily successful. 1 u/[deleted] Sep 21 '08 But the previous command wasn't a command in your example. Of course that would never be successful.
The comment i was replying to said, "In this case, what's successful is the act of setting the previous command to run in background."
I'm pointing out that, no, the act of setting the previous command to run in the background is not necessarily successful.
1 u/[deleted] Sep 21 '08 But the previous command wasn't a command in your example. Of course that would never be successful.
But the previous command wasn't a command in your example. Of course that would never be successful.
View all comments
Show parent comment
3
u/sn0re May 30 '08
&& only executes the second command if the first is successful. However, since the first & sends the command to the background, it is always taken to be successful.