It looks like there is some confusion here.
What fpmurphy is trying to say is that you need to comment out the lines (if needed) that don't need to be executed using # sign, like this:
In case you are trying to use a HERE document, as suggested you need to get rid of the colon : in front of the sign <<, and no space at the final COMMENTBLOCK :
Quote:
<<COMMENTBLOCK
if [ "$month -eq 3 ] || [ "$month -eq 6 ]
then
echo "inc = 1"
else
echo "inc = 2"
fi
COMMENTBLOCK
So if you need those lines commented out you need to use the first code.
If you are trying to achieve something else with your script, then you need to look in your script and change it accordingly, or post here what are you trying to achieve.
Hi All
I have a requirement like, where a file gets generated in a particular dir and once the file is ready and available then I want to execute rest of the script, because untill and unless the file exists and is available there is no use of running rest of the commands in that script.
... (5 Replies)
Hi
can any body pls help me :
I have a file Which Content is like following:
p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog
ca:3:respawn:/opt/GoldWing/currentPM/local/critagt > /dev/msglog 2<>/dev/msglog
ca:3:respawn:/opt/GoldWing/currentPM/local/startcia.sh... (2 Replies)
Hi All,
I am struggling to get my head around the following issue.
I am having to comment out lines between two delimiters by placing an asterix in position 7 but retain all lines in the file and in the same order.
so for example a file containing:
...
...
DELIM1
...
...
DELIM2... (2 Replies)
Hi All,
I know we can comment by using "#" .... I want to know... is there any way to comment a whole big script easily....
In a file i need to comment more than 15 lines ........ and check the script and un comment back.
I am learning VI now so its taking lot of time to comment and un... (4 Replies)
Hi
I'm trying to comment out specific lines from /etc/fstab file, for simplicity I'm trying to use perl one liner but it errors out,
Below is the Perl oneliner I'm using,
perl -wlp -i -e 'BEGIN{$flag=0}if (!/root/) && (!/boot/) && (!/tmpfs/) ) {$flag =1;} elsif (/^$/) {$flag=0} if ($flag)... (2 Replies)
I have an xml file which has following code :
<abc-ref>
<abc-name>abc.efg.hij.klm</abc-name>
</abc-ref>
I want to comment this whole section out and I have written the following script : (where "hij" is unique string in the file)
TEMPFILE=replaceYY.tmp
file=hello.xml
sed -n... (6 Replies)
I have found this bit of code that nearly does what I want.
Basically 3 input fields, I want to copy t2 to t3 as it's typed but only if t1 contains data AND t3 is empty:
<input type="text" id="t1" />
<input type="text" id="t2" />
<input type="text" id="t3" />
<script> var t2 =... (4 Replies)
Discussion started by: barrydocks
4 Replies
LEARN ABOUT DEBIAN
logcheck-test
logcheck-test(1) General Commands Manual logcheck-test(1)NAME
logcheck-test - test new logcheck rules easily
SYNOPSIS
logcheck-test [-q|-i] [-a|-s|-l FILE] [-e] [-P PREFIX] [-S SUFFIX] RULE
logcheck-test [-q|-i] [-a|-s|-l FILE] -r RULEFILE
DESCRIPTION
logcheck-test parses a log file for matching lines specified by a single rule or a rule file. If using a single RULE you can set a PREFIX
and a SUFFIX to write new rules easily.
OPTIONS -h, --help
Show usage information
-a, --auth.log
Parse /var/log/auth.log for matching lines
-s, --syslog
Parse /var/log/syslog for matching lines
-l, --log-file FILE
Parse FILE for matching lines
-i, --invert-match
Show line that don't match the RULE or the RULEFILE
-q, --quiet
Suppress rule summary at the end of output
-e, --surround-rule
Surround RULE with standard prefix and suffix:
^[[:alpha:]]{3} [ :[:digit:]]{11} [._[:alnum:]-]+ RULE$
-P, --append-prefix PREFIX
Append PREFIX to rule prefix. Option can be given multiple times
-S, --prepend-suffix SUFFIX
Prepend SUFFIX to rule suffix. Option can be given multiple times
-r, --rule-file RULEFILE
Use file RULEFILE for rule input
EXAMPLES
With logcheck-test you can easily write and test new rules.
Test a single rule against /var/log/syslog:
logcheck-test -s "RULE"
Test a single rule against ~/log, surround the rule with standard prefix and suffix and append "kernel " to prefix:
logcheck-test -l ~/log -e -P "kernel " "RULE"
Test the rules in rulefiles/linux/ignore.d.server/kernel against ~/log:
logcheck-test -l ~/log -r rulefiles/linux/ignore.d.server/kernel
Test which lines the rules in rulefiles/linux/ignore.d.server/kernel doesn't match:
logcheck-test -l ~/log -r rulefiles/linux/ignore.d.server/kernel -i
EXIT STATUS
On successful matching logcheck-test will complete with exit code 0. An exit code of 1 indicates no successful matching.
An exit code greater then 1 indicates an error occurred. Textual errors are written to the standard error stream.
SEE ALSO logcheck(8)AUTHOR
logcheck is developed by Debian logcheck Team at alioth: http://alioth.debian.org/projects/logcheck/. This manual was written by Hannes von
Haugwitz <hannes@vonhaugwitz.com>.
Feb 19, 2010 logcheck-test(1)