[Sugar-devel] Quoting in shell scripts (was: Re: [sugar-devel] Recent fiddlings with Print Support)
Jonas Smedegaard
dr at jones.dk
Sun May 17 11:10:13 EDT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
On Sat, May 16, 2009 at 06:20:56PM +0530, Vamsi Krishna Davuluri wrote:
>Hello! I finally figured what was going wrong with my script.
>
>
>Jonas, I have tried implementing your suggestions. using mktemp, XXXXX,
>and also a -m 077. The code doesnt work for some reason that way. lpr
>gets me a failed job.
Try piece by piece to locate which part does not work in your
environment.
Or try invoking the script with "bash -x" to enable debugging.
>[Vamsi at localhost Desktop]$ $(set -e abiword [...]
I believe the synax is this:
[Vamsi at localhost Desktop]$ $(set -e; abiword [...]
And if I didn't mention it clearly enough before, I try do it now: I
strongly recommends to completely avoid subshells (those `` and $() and
() constructs) as they are more complex to do right!
>The lp user of lp group ( cups script executor) messes up with
>permissions when executing commands in a subshell, that's really messed
>up. my rationale is, in a subshell the lp user has no longer domain.
>Also, CUPS doesnt write to our /tmp folder, instead has its own folder
>defined somewhere.
No surprise. Please read above. Read twice if needed ;-)
- Jonas
- --
* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136 Website: http://dr.jones.dk/
[x] quote me freely [ ] ask before reusing [ ] keep private
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEAREDAAYFAkoQKNQACgkQn7DbMsAkQLhpMwCfR7iWoQ41oXptjU0I/GnDJl10
awEAn3U0W9vvbpC4m8GgKYCXJVTgMjtR
=w35a
-----END PGP SIGNATURE-----
More information about the Sugar-devel
mailing list