. $startApache wrong syntax?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting . $startApache wrong syntax?
# 1  
Old 06-24-2006
. $startApache wrong syntax?

Hi All,

why doesn't this code start apache at boot?

Cheers.

coolboarderguy...

startApache=/usr/local/apache2/bin/apachectl start
if [ -f "$startApache" ] ; then
. $startApache
fi
# 2  
Old 06-25-2006
Try removing that .
# 3  
Old 06-25-2006
Code:
startApache="/usr/local/apache2/bin/apachectl start"
if [ -f "$startApache" ] ; then
. $startApache
fi

OR

Code:
action=start
apache="/usr/local/apache2/bin/apachectl"
if [ -f "$apache" ] ; then
. $apache $action
fi

# 4  
Old 06-26-2006
Quote:
Originally Posted by Ambikesh
Code:
startApache="/usr/local/apache2/bin/apachectl start"
if [ -f "$startApache" ] ; then
. $startApache
fi

OR

Code:
action=start
apache="/usr/local/apache2/bin/apachectl"
if [ -f "$apache" ] ; then
. $apache $action
fi

Hi All,

the 1st one didn't work, but the 2nd one did. Why wouldn't the 1st one work? Cheers.

coolboarderguy...
# 5  
Old 06-26-2006
Should work budy..
Any specific error...
# 6  
Old 06-26-2006
Of course it didn't work, there is no file called "/usr/local/apache2/bin/apachectl start"
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why result is wrong here ? whether break statement is wrong ?

Hi ! all I am just trying to check range in my datafile pls tell me why its resulting wrong admin@IEEE:~/Desktop$ cat test.txt 0 28.4 5 28.4 10 28.4 15 28.5 20 28.5 25 28.6 30 28.6 35 28.7 40 28.7 45 28.7 50 28.8 55 28.8 60 28.8 65 28.1... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies

2. Shell Programming and Scripting

I can't get what I'm doing wrong!

I am making a shell script that will have "shortcuts" to do different tasks and I can't get what I'm doing wrong (this is just a test script) read cake if then echo "1 it is" fiit outputs: 1: : bad variable namecake test.sh: 27: test.sh: Syntax error: end of file unexpected (expecting... (22 Replies)
Discussion started by: kitay
22 Replies

3. Shell Programming and Scripting

syntax of if condition in ksh is wrong

The syntax of 'if' conditionals in bash and ksh seems different. I am trying to check for a particular version using 'if' in ksh. This very simple syntax gives syntax error. I have tried many variants, but no go. Please correct the syntax. Later I will expand it to 'if' and 'else'. #!/bin/ksh... (8 Replies)
Discussion started by: nivedhitha
8 Replies

4. Programming

What am I doing wrong!!!

Hi all, I'm just getting back in to C programming after some time and I thought I would start off with a simple XOR encryption program. However I'm having trouble getting it to work. The code in prompt() function works great when it is just placed in side of main() however I want to be able to... (5 Replies)
Discussion started by: WelshDave
5 Replies

5. UNIX for Dummies Questions & Answers

what is wrong with this tr -d?

here is my command in bash shell on Mac OS X tiger: history | tr -d emacs here is what I get: hitory | grp "" | tr -d "" hitory | grp "" | tr -d """" hitory | grp "" | tr -d '' hitory | grp "" | tr -d '' hitory | grp "" | tr -d '' hitory | grp "" | tr -d... (3 Replies)
Discussion started by: cleansing_flame
3 Replies

6. UNIX for Dummies Questions & Answers

can someone tell me what im doing wrong here

Got It Workng Woohoo Edited (2 Replies)
Discussion started by: iago
2 Replies

7. Shell Programming and Scripting

Whats wrong with the syntax

Whats wrong with below logic or syntax???? (4 Replies)
Discussion started by: dsravan
4 Replies

8. UNIX for Dummies Questions & Answers

What’s wrong with the following?

Hello, Im new to Linux/Unix. can anyone answer this for me ? Thank you Brannon What's wrong with the following? ls -ld htdocs drwxr-x--- 3 root root 8192 Mar 10 10:41 htdocs/ :o (8 Replies)
Discussion started by: vrn
8 Replies

9. Shell Programming and Scripting

where have i gone wrong?

ok, i wrote a script called purge.sh which i referred to in another thread. It prompts the user for a keyword and a username and then kills all of the entered username's processes containing that keyword. However before it does that it asks you how many searches you wish to perform and sets a... (3 Replies)
Discussion started by: Blip
3 Replies
Login or Register to Ask a Question