10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Below is what i have in my script.
htcount=$(curl -s --user tomcatstatus:tomcatstatus http://`hostname`.mypc.com:887/manager/jmxproxy?qry=Catalina:type=ThreadPool,name=\"http-nio-887\" |grep sBusy | cut -d ' ' -f2)
echo $htcount
if ; then
echo "more than 10"
else
echo "Less than 10"
fi... (6 Replies)
Discussion started by: mohtashims
6 Replies
2. Shell Programming and Scripting
I do have a shell file where I call many unix commands . I would like to add a regular expression step in that shell file, where a text file, say Test.txt has to be openned and all the :'s should be replaced.
Basically apply the follwoing regular expression:
:%s/://g
to that particular text... (2 Replies)
Discussion started by: Lucky Ali
2 Replies
3. Shell Programming and Scripting
Hi,
i want to check if a variable var1 is not a or b or c
pseudo code:
If NOT (var1 = a or var1 = b or var1 = c)
then
...
fi
I want to use POSIX complaint Korn shell, and for string comparison
For the following code, logical.sh
#!/usr/bin/ksh
var="j"
echo "Var : $var"
if ! { || ||... (12 Replies)
Discussion started by: ysrini
12 Replies
4. Shell Programming and Scripting
Please tell me how to nest logical expressions in bash. I would like to nest logical expressions for arguments of the "test" command on bash.
The following pseudo-code shows my intention.
// pseudo code
if (exp1 AND (exp2 OR exp3))
{
Output true;
}
else
{
Output false;
}
... (11 Replies)
Discussion started by: LessNux
11 Replies
5. Shell Programming and Scripting
I have the following script:
For catching errors like:
But the regular expression ERROR*memory inside case doesn't seem to be working.
The output of bash -x scriptname is:
Please help (5 Replies)
Discussion started by: proactiveaditya
5 Replies
6. Shell Programming and Scripting
Hi
I want to send a status mail if daily or weekly or monthly batch completed or aborted. Here is the code.
if && &&
||
Else if &&
&& ||
Else if &&
&& ||
then
mailx –s “Status Report” sumone@sumthing.com
else
print ”try again”
Plz suggest the changes. (3 Replies)
Discussion started by: Avi
3 Replies
7. Shell Programming and Scripting
I'm pretty sure I already know the answer to this, but I want to make sure I'm not overlooking anything. I'm working on a log monitoring script and every 10 lines I want to display a summary of events. The thing is, there are a lot of possible events, that likely won't have happened, so I only want... (0 Replies)
Discussion started by: DeCoTwc
0 Replies
8. UNIX for Dummies Questions & Answers
I have some geometric data (X Y) that is in the wrong scale. My raw data is in mills but it needs to be in tenths of a mil
I am pretty familiar with awk and sed
I want to use awk to divide $1 and $2 by .1
I'm just not sure of the syntax $1 and $2 are variables and .1 is fixed
simple... (3 Replies)
Discussion started by: awk_sed_hello
3 Replies
9. Shell Programming and Scripting
Hi there, probably a really simple question to answer but i cant seem to find it
can I use a logical AND (&&) within a CASE statement ie (ps this is useless syntax but youll get the idea
case "$var1","$var2" in
'Billy' && 'Bobby')
... (1 Reply)
Discussion started by: hcclnoodles
1 Replies
10. UNIX for Dummies Questions & Answers
hi I have following if condition
line_by_line="0000000000000tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt"
if
then
echo "Exclusion criteria"
else
echo "Not exclusion criteria"
fi
above condition works perfectley but if i add one more logical condition... (3 Replies)
Discussion started by: mahabunta
3 Replies