Re: F18, F19 webalizer problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



04/27/2013 03:49 PM, Cameron Simpson wrote:
On 26Apr2013 09:12, Patrick O'Callaghan <pocallaghan@xxxxxxxxx> wrote:
| On Fri, 2013-04-26 at 15:36 +0300, Cristian Sava wrote:
| > Webalizer is enabled via /etc/sysconfig/webalizer but I don't understand
| > why /etc/cron.daily/00webalizer has this line:
| >
| > [ "z$WEBALIZER_CRON" != "zyes" ] && exit 0
| >
| > that I think it should be (and it is working this way)
| >
| > [ "$WEBALIZER_CRON" != "yes" ] && exit 0
| >
| > What is the mistery?
|
| The "z$Foo" != "zbar" style is idiomatic in Shell scripts. I think it's
| to ensure portability between Shells with slightly different expression
| rules.

In particular it avoids issues where $WEBALIZER_CRON looks like a test
operator such as "-z" or something unfortunate.


Also there may be situations where $SOME_VAR evaluates to null. Then a test looks like [ != "something" ] which is guaranteed to break. By (pre|post)fixing each side with an arbitrary character such as Z that same scenario would yield [ "Z" != "Zsomething" ] and would survive shell parsing.
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux