[plug] Script

Mrrob rob at mrrob.info
Tue Sep 19 09:02:31 AWST 2017


Hi Gary,

"fi" is the end tag for an if statement.
"exit" is one way to exit a script but there are many others.

Detaching a process from a script can be done many ways. The terms you should search for are:

nohup
disown

Perhaps there are other solutions to your problem such as having a service control transmission, adding it to your DE's 
startup etc.

Regards,

---
mrrob
---

On 19/09/17 08:44, Garry wrote:
> HI all,
> 
> This is going to seem pretty basic, but I don't know the correct words
> to search for the answer.
> 
> I need to write a quick script to start a program, exit and leave the
> program running.
> I know at the command line you put "&" at the end to return the command line.
> 
> "
> transmission-gtk &
> "
> 
> I believe "fi" makes a script exit. But I get a warning message
> "(transmission-gtk:*processnum*):WARNING **:Couldn't connect to
> accessibility bus: Failed to connect to socket /tmp/dbus-OHNORYryZL:
> connection refused
> ./starttorrent: line 2: syntax error near unexpected token 'fi'
> ./starttorrent: line 2: 'fi'
> "
> 
> And here's the funny thing.. Despite the warning, it works. If I
> remove the "fi", it starts, the warning is the same except the lines
> referring to "fi" are missing and the script doesn't exit. But it
> still starts transmission.
> 
> I also tried
> "
> #/bin/bash
> transmission-gtk & (and without the &)
> exit 0
> "
> But it works as though the "fi" was there.
> 
> I guess at the end of the day for completeness I'd start with "killall
> transmission-gtk" to stop multiple instances, but I don't want to
> complicate things at this stage...
> 
> Can anyone cast some light on this for me please?
> 
> Regards
> 
> Garry
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://lists.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.org.au
> PLUG Membership: http://www.plug.org.au/membership
> 
> 


More information about the plug mailing list