Author Topic: Script to start GNC  (Read 510 times)

Offline straybit

  • Member
  • ***
  • Posts: 52
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
Script to start GNC
« on: June 26, 2020, 01:15:56 pm »
I'm running flatpak on Pepermint
Spoiler (click here to view / hide)
[close]
Since GNC now wants to put some files in the directory where I started it (via a soft-link), I'm attempting to write a script to start GNC.  I did a lot of .bat files in DOS (back before they added some switches) and am having trouble converting to Bash
Here is what I've got so far with annotations:
Spoiler (click here to view / hide)
[close]
If any one has any help for this, I would be very appreciative.   I have googled bash commands.  I did note that find will locate my data file but it also lists the log files, etc.

Bruce

Offline Kasey00

  • Newly Subscribed
  • *
  • Posts: 4
  • Karma: 1
  • New Forum User
    • View Profile
Re: Script to start GNC
« Reply #1 on: June 28, 2020, 03:46:38 am »
This message has been deleted for containing possibly malicious code in a link provided as part of the user's "answer" to this issue.  ;)
« Last Edit: July 04, 2020, 01:58:33 am by Slim.Fatz »

Offline straybit

  • Member
  • ***
  • Posts: 52
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
Re: Script to start GNC
« Reply #2 on: June 28, 2020, 01:37:37 pm »
Thanks for your reply, Kasey00.

I don't understand where I'm trying to convert a string to either upper or lower case.

Bruce

Offline straybit

  • Member
  • ***
  • Posts: 52
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
Re: Script to start GNC
« Reply #3 on: July 17, 2020, 09:57:26 am »
OK!  I've made some progress.  Here is LaunchGNC script:
Spoiler (click here to view / hide)
[close]
If we are in the correct folder, it will launch gnucash.

One difficulty is that PWD seems to have a space appended to the end.  I can't find a trim function in Bash so I can write one in C.

My problem is getting there.  I have tried find
Spoiler (click here to view / hide)
[close]
This shows 2 potentials.  What I want to do is to select one of these at which time the path and basename would be stored in the appropriate variable.

Any suggestions or ideas where to look would be appreciated.

Bruce