Mac OS Terminal Zip Command – Run from Omnis
I’ve found a few things that make life easier when writing shell scripts.
1. What runs in an interactive shell is not necessarily what will run in a
script because the environment could be different. You may have to
explicitly pass environment variables to your script.
2. It is good practice to explicitly specify the shell that the script
should be using on the first line of the script by using the hash bang
nomenclature, e.g. #! /bin/sh, #! /bin/bash, #! /usr/bin/env python
3. Not all shells have the same capabilities and syntax. Dash, Bash, Zsh
all have different capabilities. I use Bash because I know it even though I
know Dash is faster and lighter weight. For the things I do with shell
scripts, optimizing for memory or CPU utilization, or speed simply isn’t
worth the effort of learning something else. I’m also not religious about
using Bash for scripting. I know Python well so quite often, I’ll knock out
something that probably could have been done in Bash in Python simply
because I can and I find Python to be more readable.
4. Embedded spaces and mixed case in file and directory names are a hassle
when you’re scripting. If at all possible, I recommend you avoid them and
use folder-name/file-name rather than Folder Name/File Name.
5. Adding “set -o xtrace” early in your script is helpful in debugging.
That, coupled with “set -o verbose” and using “echo” statements where you
need to see the values of variables is useful. Note: this is all applicable
to Bash. If your Mac uses some other shell, like zsh, you may have to
adjust accordingly.
Regards,
Clifford Ilkay
+1 647-778-8696
On Fri, Nov 17, 2017 at 4:44 PM, Michael Mantkowski <michaelj@clientrax.com>
wrote:
> And I should have mentioned the Alex’s modification does work in Terminal
> as well.
>
> *********************************************************************
> Michael Mantkowski
> ClienTrax Software
> 1-614-875-2245
> *********************************************************************
>
>
> —–Original Message—–
> From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On
> Behalf Of Michael Mantkowski
> Sent: Friday, November 17, 2017 4:41 PM
> To: ‘OmnisDev List – English’ <omnisdev-en@lists.omnis-dev.com>
> Subject: RE: Mac OS Terminal Zip Command – Run from Omnis
>
> Thanks Alex,
>
> I tried that and that does it seem to be it either.
>
> I had actually already used full paths that I got from Omnis. i.e.
> /Users/Michael/Desktop/Omnis 4321/Pictures
>
> I was just shortening it since Terminal allowed me to do it.
>
> Anyway, same error with all three versions.
>
> It’s going to be something stupid. I can feel it.
>
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com