WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Abiword.scm command line bug  (Read 11814 times)

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11695
Re: Abiword.scm command line bug
« Reply #15 on: April 29, 2012, 04:44:27 PM »
Hi uggla
Quote
SAVE_ARGS=$*
Not sure if it matters here, but I think I read somewhere that $@ is more commonly used because it preserves spaces
where $* doesn't in some situations.

Offline uggla

  • Sr. Member
  • ****
  • Posts: 438
Re: Abiword.scm command line bug
« Reply #16 on: April 30, 2012, 02:23:27 AM »
I'll fix the script for already quoted paths.

Offline uggla

  • Sr. Member
  • ****
  • Posts: 438
Re: Abiword.scm command line bug
« Reply #17 on: April 30, 2012, 05:34:03 PM »
Here's a much better script:
Code: [Select]
#!/bin/sh

for p do
case ${p:0:1} in
-) params="${params} ${p}";;
/) params="${params} \"${p}\"";;
*) params="${params} \"$PWD/${p}\"";;
esac
done

cd /apps/abiword
export LD_LIBRARY_PATH="local/lib"
export PATH="local/bin:$PATH"

exec /apps/abiword/abiword ${params}
« Last Edit: May 01, 2012, 03:17:41 AM by uggla »

Offline uggla

  • Sr. Member
  • ****
  • Posts: 438
Re: Abiword.scm command line bug
« Reply #18 on: May 02, 2012, 06:51:51 AM »
Sorry, here's a script that actually works  ;)

Code: [Select]
#!/bin/sh

for arg do
case ${arg:0:1} in
-) SAVE_ARGS="${SAVE_ARGS}${arg}|";;
/) SAVE_ARGS="${SAVE_ARGS}${arg}|";;
*) SAVE_ARGS="${SAVE_ARGS}$PWD/${arg}|";;
esac
done
IFS='|'

cd /apps/abiword
export LD_LIBRARY_PATH="local/lib"
export PATH="local/bin:$PATH"

/apps/abiword/abiword ${SAVE_ARGS}

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Abiword.scm command line bug
« Reply #19 on: May 02, 2012, 07:32:01 PM »
Hi, I am not ignoring this, time is just tight now, I will visit it soon.

Offline uggla

  • Sr. Member
  • ****
  • Posts: 438
Re: Abiword.scm command line bug
« Reply #20 on: May 27, 2012, 11:36:43 AM »
Still too busy?  :D

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Abiword.scm command line bug
« Reply #21 on: May 27, 2012, 04:42:39 PM »
I will look at that last script tonight and  possibly work it in.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Abiword.scm command line bug
« Reply #22 on: May 27, 2012, 07:42:55 PM »
Works like a charm with multiple command line arguments, like "/apps/abiword/bin/abiword -u tc /home/tc/file".

I am uploading the fix now, and I will use this approach with the other converted scms.

Offline uggla

  • Sr. Member
  • ****
  • Posts: 438
Re: Abiword.scm command line bug
« Reply #23 on: May 28, 2012, 01:00:35 AM »
Great!  ;D

Offline uggla

  • Sr. Member
  • ****
  • Posts: 438
Re: Abiword.scm command line bug
« Reply #24 on: June 05, 2012, 06:08:21 AM »
Xarchiver would be much more useful (to me) if it were updated with this wrapper.