New to Shell scripts and where do you put them


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting New to Shell scripts and where do you put them
# 1  
Old 12-20-2009
New to Shell scripts and where do you put them

Hey all,

I'm trying to setup an external XML feed for my site and I've received a script to make it all possible. This script places the feed in the MySQL datbasa and can remove the previous feed. Because I am new to this I would like to ask a simple question. Could somebody tell me where do I have to put the shell script? In the public html or in the root of the site or do I need to make a link public_html/scripts? I've got not a clue to make it eassier I've included my files also.

Thanks in advance for your time!

Chris

Last edited by chrisdegrote; 01-26-2010 at 04:46 PM..
# 2  
Old 12-20-2009
Supposing you have a ssh or direct access to your server, check your path by typing env and search for something like
Code:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

The different paths are separated by ':'.
If you put your script in on of those directories, it will be launchable without precising the path to it. But generally, the user isn't allowed to write to those directories - and that's safe - so you will have to put them there as root.
Maybe, in your path is there a directory like /home/your_user_name/bin, you can use that one, else i recommend usr/local/bin which contains often a few files. In other cases, you can put where you want but remember you'll have to type the full path to execute them, like
Code:
ssh your_user_name@server_URL /path/to/your/script/scriptname # remote by ssh
# or 
/path/to/your/script/scriptname  # directly on the server

Don't forget to make them executable by
Code:
chmod +x name_of_script

# 3  
Old 01-26-2010
Merci Beaucoup pour votre aide! I really appreciate it but I can't get it to work yet so could you tell me that the cgi-bin is also allright for placing the shell scripts? To give you some insight I've put a image of my site structure. Image

Thanks again!
# 4  
Old 01-26-2010
You should put the script in the cgi-bin folder. Here is some more input:

run bash script from cgi-bin or as cgi - Linux Forums
Create a GCI using bash scripting
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script variable $1 used with put command

I have the following script used, i am new to shell scripting. tryign to understand. in the put $BASE_FOLDER/$base_name holds which path. What does it mean by $1 second path in put command is it constructing this path: /user/hive/warehouse/stage.db/$1 what is $1 holding in above path. ... (2 Replies)
Discussion started by: cplusplus1
2 Replies

2. What is on Your Mind?

Fun things to put in comments in scripts?

Approaching the end of my portion of some STIG/DOD compliance automation and I was challenged by a co-worker to include a story in my code. There are blocks of code that need to be kept the way they are for GIT/Gerrit and then compliance, but otherwise I changed out all the comments into a... (2 Replies)
Discussion started by: Vryali
2 Replies

3. Shell Programming and Scripting

how to put data using shell script to a excel file

Hi, Can any one tell me how to put data using shell script to a excel file from text file to other columns of excel file,leaving first column unaffected i.e it should not overwrite data in first column. Say my text file data is: 15-dec-2008 15-dec-2009 16-dec-2008 16-dec-2009 say my first... (1 Reply)
Discussion started by: siri_886
1 Replies

4. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

5. Shell Programming and Scripting

read a file in shell and put result in a line

Hi All, I have a to read a file and put the result in one line. The i am reading from contain the data like below. 1 signifies the beging of the new line. (6 Replies)
Discussion started by: lottiem
6 Replies

6. Shell Programming and Scripting

Need to put a breakpoint in gdb using bash shell

I want a way to put a break point in gdb by runing a shell script. Actualy I wanted to do certain automisation of a long manual process, which includes starting of a process in background and then taking the process ID of that process and then attach the gdb to that process ID. Then finaly... (4 Replies)
Discussion started by: kapilkumawat
4 Replies

7. Shell Programming and Scripting

put a shell in for statement

I'm a newbie here, today I've got a problem. Here's the shell: b.sh #!/bin/bash rm -rf $1 a.sh #!/bin/bash for file in '/root/Desktop/test/*' do echo $file sh ./b.sh $file done ls /root/Desktop/test When I sh a.sh, the result is : (2 Replies)
Discussion started by: very.very.sorry
2 Replies

8. UNIX for Dummies Questions & Answers

place to put statup scripts?

I have written a script to start websphere server, I dont know where to put the file in the OS . please put me the place to put the starup scripts in linux, solaris and AIX? (2 Replies)
Discussion started by: jayaramanit
2 Replies

9. AIX

Difference between writing Unix Shell script and AIX Shell Scripts

Hi, Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies

10. UNIX for Dummies Questions & Answers

where to put shell scripts?

This could be a really dumb question, but for a newbie trying to learn, some help would be appreciated. When you write a shell script, what extension should it have, and more importantly, where do you put it???? (7 Replies)
Discussion started by: ober5861
7 Replies
Login or Register to Ask a Question