whats error in code ??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting whats error in code ??
# 1  
Old 07-21-2010
whats error in code ??

Code:
if `egrep -c "safe_mode" /usr/local/lib/php.ini` - gt 0 && " `egrep -c "safe_mode" /usr/local/lib/php.ini` = "On" "
    then
        echo " Good "
        exit
    else
        echo " Not Good ";
fi


and

# 2  
Old 07-21-2010
The command
Code:
egrep -c "safe_mode" /usr/local/lib/php.ini

returns a number, so the test will failed all time.

Jean-Pierre.
# 3  
Old 07-21-2010
I just want to fix a sentence which in the top
# 4  
Old 07-21-2010
Not clear what the code is meant do do, but it does clearly contain syntax errors.
Please show us some sample lines from the file /usr/local/lib/php.ini , highlighting some which count as "Good". We will be particularly interested in the special meaning of "On".
# 5  
Old 07-21-2010
Code:
if [ `grep "safe_mode" /usr/local/lib/php.ini` ] && [ `grep "safe_mode" /usr/local/lib/php.ini | sed 's/.*=//'` == On ]
then
        echo " Good "
        exit
    else
              echo " Not Good Safe Mod is Off";
fi

Code:
 
# cat /usr/local/lib/php.ini
#*************
#Example 
safe_mode=On
#Example
#Example

Code:
# ./myscript
 Good

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Function works, trigger causes syntax error, whats my fault??

Needing a hint. Creating that function called Meter my simple script works well. What I want now is to start the last four commented lines to include or trigger a reaction, if there are more than n lines in that .txt-file it shall display that message for example. But the interpreter says there is... (3 Replies)
Discussion started by: 1in10
3 Replies

2. Shell Programming and Scripting

Whats the error in this script ?

Can someone help me figure out the error with this simple script: #!/bin/sh fact() { if ; then p=`fact expr $1 - 1` else echo $1 fi echo `expr p \* $1` } echo "Enter a number you wish to calculate factorial... (5 Replies)
Discussion started by: sheelscripter
5 Replies

3. Shell Programming and Scripting

error code 137 and error code 35072

Hi while trying to run few scripts /afs/ae.ge.com/informatica/ardw/dev/bin/cdw_ar_update_recvbal.sh this script contains the below data load_dir=/afs/ae.ge.com/informatica/ardw/dev/data prog_dir=/afs/ae.ge.com/informatica/ardw/dev/bin ctl_dir=/afs/ae.ge.com/informatica/ardw/dev/ctl... (1 Reply)
Discussion started by: laxmi131
1 Replies

4. Shell Programming and Scripting

Whats wrong With This Code

Hi , iam new with sed command D:\bfx_db>sed -ne '/^SP2-*:/S/^\<.*\.*\>$/\2\p' reg.sql >>D:\out.log The filename, directory name, or volume label syntax is incorrect. Here my source file is reg.sql , i need the output in out.log Can anybody Help on this???? (4 Replies)
Discussion started by: mhdmehraj
4 Replies

5. Shell Programming and Scripting

whats wrong in my code

Code: #!/usr/bin/perl -w use strict; use warnings; #Clears Screen $CLEAR=`clear`; print $CLEAR; i get the below error: Global symbol "$CLEAR" requires explicit package name at ./mutmg.pl line 6. Global symbol "$CLEAR" requires explicit package name at ./mutmg.pl line 7. (1 Reply)
Discussion started by: sophos
1 Replies

6. Shell Programming and Scripting

##*_ - whats this?

Hi all, could you please tell me whats this stands ##*_ 0##*/ i knew this alone if some more is there please tell me that also. (3 Replies)
Discussion started by: Arunprasad
3 Replies

7. Shell Programming and Scripting

Whats the error in this script

#!/bin/sh #usblcd clear while true; do tail -1 /root/Myprogs/apurva.log > /root/Download/usr/bin/output.txt cat /root/Download/usr/bin/output.txt | echo `awk '{if ($3 == "Connection"&&$4 == "Established") print"Connection Established "} else if {($3 == "DTNCO"&&$4 ==" Sent" && $5="Packet")... (2 Replies)
Discussion started by: appu1987
2 Replies

8. Shell Programming and Scripting

whats wrong with this code

ls -ld | grep $1 /etc/passwd | cut -d: -f6 i need see the content... (4 Replies)
Discussion started by: nadman123
4 Replies

9. Shell Programming and Scripting

Whats the meaning of this code

Hi all, I am unable interpret this code ......... nohup $OPSSHLPATH/mkt_sas_load_cic.sh $db_name $process_id $loc_mm > $OPSLSTPATH/mkt_sas_load_cic.out & Thanks ....In advance (7 Replies)
Discussion started by: dhananjaysk
7 Replies

10. Shell Programming and Scripting

Whats does this mean

Found this piece of code written in ksh. I have no ideas what do the stuff like ${SRF##*\.} do. SUFFIX=${SRF##*\.} if ; then SUFFIX="" fi I have encountered similar expressions in other programs also. Any pointers on where to learn more about these... (1 Reply)
Discussion started by: jyotipg
1 Replies
Login or Register to Ask a Question