Script works in terminal but not from Nautilus, very frustrating!

Johnny Rosenberg gurus.knugum at gmail.com
Mon Jan 12 19:54:54 UTC 2015


2015-01-12 20:44 GMT+01:00 Johnny Rosenberg <gurus.knugum at gmail.com>:

> 2015-01-12 0:00 GMT+01:00 Karl Auer <kauer at biplane.com.au>:
>
>> On Sun, 2015-01-11 at 16:36 -0600, C de-Avillez wrote (quoting someone
>> else):
>> > > > The only line that doesn't seem to work in my script when run from
>> > > > Nautilus, is that ”megals” line, everything else seems to work.
>>
>> If just one line doesn't work, then the script is running. That leaves
>> the environment - especially the path - and non-escaped characters...
>> you have a few quotes in there that might need escaping.
>>
>
> I'm not sure I know what lines you are referring to.
> Remember that those lin I quoted work when I run it in a terminal.
>
> Before I got home after work to read my mail I actually think I suddenly
> knew what was wrong, but I didn't do any tests yet. I think it could be an
> environment thing, just like you and C de-Avillez mentioned. The megals
> command, and all the other MegaTools commands requires login and password.
> To avoid hard coding that, I use the ~/.megarc file, and it lookd like this:
>
> [Login]
> Username = myname at address.com
> Password = blahblahblahblahblah
>
> The rights are set to rw- --- ---
>
> Anyway, I suspect that megals doesn't read the ~/.megarc file when run
> from Nautilus, so I probably only get an authorisation error, which I can
> not see since there is no terminal… Maybe I can, and should, pipe it to yad
> (a great Zenity fork that I use a lot).
>
> I think I can specify the rc file when running the command. If not, I can
> always use the --user and --password flags to enter it in the script (just
> for testing). Other ideas are welcome, of course…
>
> Maybe this isn't what is the problem at all, I'm only guessing here, but I
> will find out… but right now I'm hungry…
>
>
>
YEEEES!!! That was it!

Old lines:
export OnlineFlacLink=$(megals \
--export "${OnlineFlacFile}" \
| awk '{print $1}')

New lines:
export OnlineFlacLink=$(megals \
--config "${HOME}/.megarc" \
--export "${OnlineFlacFile}" \
| awk '{print $1}')


The --config flag specifies what rc file to read.
Problem solved!

Thanks for participating!


Kind regards

Johnny Rosenberg
ジョニー・ローゼンバーグ




>
>
> Kind regards
>
> Johnny Rosenberg
> ジョニー・ローゼンバーグ
>
>
>
>>
>> Regards, K.
>>
>> --
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Karl Auer (kauer at biplane.com.au)
>> http://www.biplane.com.au/kauer
>> http://twitter.com/kauer389
>>
>> GPG fingerprint: 3C41 82BE A9E7 99A1 B931 5AE7 7638 0147 2C3C 2AC4
>> Old fingerprint: EC67 61E2 C2F6 EB55 884B E129 072B 0AF0 72AA 9882
>>
>>
>>
>> --
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20150112/4c17292e/attachment-0001.html>


More information about the ubuntu-users mailing list