Re: [Hampshire] bash error
On 26/02/2021 09:30, Brad Macpherson via Hampshire wrote: G'day Owain, I'm slightly surprised that works at all without a semicolon :-) Don't forget that an ampersand IS a semi-colon, with the added feature that the command that it terminates gets run in the background. Which is very useful when running several commands in parallel: for x in 1 2 3; do echo $x & done Cheers, Chris -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] bash error
Thanks Brad. The second one solves my conundrum. 'cd ~/somedirectory && (ristretto * & geany progress &)' Owain On 26/02/2021 09:30, Brad Macpherson via Hampshire wrote: G'day Owain, I'm slightly surprised that works at all without a semicolon :-) On 26/02/2021 09:23, Owain Clarke via Hampshire wrote: Hi. Could someone help me with the error of my ways? I'm sure this one is dead simple but I can't see it. I have this alias:- alias my_alias='cd ~/somedirectory && ristretto * & geany progress &' The ristretto bit works as expected, but I thought that the text file that opened would be ~/somedirectory/progress, but instead it creates ~/progress. What's wrong with my syntax? Thanks Owain My guess is that the && is tying together 'cd ~/somedirectory && ristretto * &' which then is backgrounded; 'geany progress &' is invoked separately (from whichever directory you issued the alias) and backgrounded. Did you mean to do something like 'cd ~/somedirectory && ristretto * && geany progress &' or 'cd ~/somedirectory && (ristretto * & geany progress &)' instead? Cheers Brad -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] bash error
The '&' before 'geany' will put the process into the background. Is that what you want? -- Linux Tips: https://www.tiger-computing.co.uk/category/techtips/ -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] bash error
G'day Owain, I'm slightly surprised that works at all without a semicolon :-) On 26/02/2021 09:23, Owain Clarke via Hampshire wrote: Hi. Could someone help me with the error of my ways? I'm sure this one is dead simple but I can't see it. I have this alias:- alias my_alias='cd ~/somedirectory && ristretto * & geany progress &' The ristretto bit works as expected, but I thought that the text file that opened would be ~/somedirectory/progress, but instead it creates ~/progress. What's wrong with my syntax? Thanks Owain My guess is that the && is tying together 'cd ~/somedirectory && ristretto * &' which then is backgrounded; 'geany progress &' is invoked separately (from whichever directory you issued the alias) and backgrounded. Did you mean to do something like 'cd ~/somedirectory && ristretto * && geany progress &' or 'cd ~/somedirectory && (ristretto * & geany progress &)' instead? Cheers Brad OpenPGP_signature Description: OpenPGP digital signature -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --