running script in background ...
The ./script_name.sh& doesn't work for me.
I also tried it with a space between the script and the &: ./script_name.sh & This didn't work either. My script calls and closes a GUI repeatedly, which doesn't bother me too much since it just pops up behind the terminal window, but I would like to be free to move to other directories and continue my work uninterrupted without opening multiple terminal windows. Any ideas why this wouldn't be working? |
Hmmm....not working for me
[deleted]
|
I split your necro-posts out of the long-dead thread. Can you please
describe in what way the "doesn't work for me" manifests itself? Cheers, Tink |
post contents of script_name.sh please.
Please use [code][/code] tags. Thank you, |
Here are the contents of my script
Code:
#!/bin/bash change the format of each and then to combine all the days into one csv file. I'm new to bash and I'm sure there are some more efficient ways to write the script, so any constructive criticism in that regard would be appreciated. But what I mean by "not working" is that when I try to run it in the background using the ./[scriptname]& or ./[scriptname] &, everything still runs on the terminal and crowds screen as if I had run it without the &. I had assumed running in the background meant that it would leave the command line free so that I could continue working while it ran. Am I incorrect in my understanding? Thanks in advance for any feedback. |
I think you need to also redirect output. So use something like
Code:
command &>/dev/null Code:
command &>/tmp/output.log |
Thanks for the tip superdog. That seemed to work, except that I had to write it like:
Code:
command > ./log.txt & but it makes sense that you have to indicate where it should be redirected. |
All times are GMT -5. The time now is 10:24 AM. |