I want to check whether certain arguments were passed to the script, and when those are, not doing a log entry.
If those arguments are not passed, always do a log entry (new call).
Which upon these 2 commands, produces these lines within the logfiles:
vhs -h ; vhs -L
With echo i have the expected output:
21:42:46 Show Help
21:42:46 Show Logfile
21:42:49 Show Help
21:42:49 Show Logfile
However, as soon i change echo to become printf , it produces this (not wanted):
---- New call 17388 ----
21:44:19 Show Help
---- New call 17423 ----
21:44:19 Show Logfile
In addition i wanted to use [[:space:]]\\-[Lih] , but i assume that is another issue?
I've tried quoting the regex, but still fails.
System:
export LC_ALL=C ; uname -r ; echo "--" ; $SHELL --version
3.16.3-200.fc20.x86_64
--
GNU bash, version 4.2.51(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Although the filenames -L-i , and -h are not common, scripts should always assume that they might be present. Therefore, the grep -[Lih] operand should be quoted:
Thanks Don (and Neutron too), that thought was actualy in mind, but only as part of a filename.
That just solved my 2nd question, i still was fiddling around, me used the wrong quotes
EDIT:
Weird, the solved tag didnt put a [solved] prior to the threads title..
You can search on tags like solved, but they don't change the title of your thread. The solved tag is special in that it also has the side-effect of changing the color used when displaying the title of the thread from black to blue.