Create a shell script for write files with 2 parameters


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Create a shell script for write files with 2 parameters
# 1  
Old 02-17-2010
Create a shell script for write files with 2 parameters

Hello,

I'm a newbie in shell script.
So, i would like to create a shell script which take 2 IN parameters (PARAM1 and PARAM2).
This script need to create 2 files as :

I need to create this file /etc/apache2/sites-available/PARAM2 :
Code:
<VirtualHost *:80>
DocumentRoot "/home/PARAM1/www"
SuexecUserGroup PARAM1 users
ServerName www.PARAM2
ServerAlias PARAM2

<Directory /home/PARAM1/www>
AddHandler fcgid-script .php
FCGIWrapper /var/www/PARAM1/php-cgi .php
Options ExecCGI FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

# On lance un seul serveur PHP FastCGI
# qui lancera autant de fils que
# nécessaire

DefaultMaxClassProcessCount 1
DefaultMinClassProcessCount 1
</VirtualHost>

And this file /var/www/PARAM1/php-cgi :
Code:
#!/bin/bash
PHP_CGI=/usr/bin/php5-cgi
PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN

export PHP_FCGI_MAX_REQUESTS
exec $PHP_CGI

And then to do :
Code:
chown -R PARAM1:users /var/www/PARAM1



Could you help me ?
I think it's easy to do but i don't now how...

Last edited by radoulov; 02-17-2010 at 06:34 AM.. Reason: Please use code tags!
 
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 to create runtime variables based on the number of parameters passed in the script

Hi All, I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them abc.sh ---------- export Numbr_Parms=$# export a=1 while do export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies

2. Shell Programming and Scripting

How to create or convert to pdf files from csv files using shell script?

Hi, Can anyone help me how to convert a .csv file to a .pdf file using shell script Thanks (2 Replies)
Discussion started by: ssk250
2 Replies

3. Shell Programming and Scripting

Shell script compare all parameters in two files and display results

Hi , I am not familiar with shell programming. I have a requirement like i have two files .I need to compare the two files by comparing each parameter and i should produce 2 outputs. 1)i have around 35 parameters say i have one parameter name called db_name=dcap in one file and... (7 Replies)
Discussion started by: muraliinfy04
7 Replies

4. Shell Programming and Scripting

How to write a shell script to display files in single path?

Hello friends, I am a script which dispalys a multiple files with their contents. for exm: suppose two file test1.txt and test2.txt. when I run my script it have to display the below O/P. test1.txt -rw-r----- 1 sranga staff 91 Sep 23 02:18 calc.sh -rw-r----- 1 sranga ... (2 Replies)
Discussion started by: sivaranga001
2 Replies

5. Shell Programming and Scripting

Write an automated shell program(s) that can create, monitor the log files and report the issues for

Hi , Please help me getting this done. Write an automated shell program(s) that can create, monitor the log files and report the issues for matching pattern. (i) Conditions for creating log files. Log file is created with date (example 2010_03_27.log). If the log file size is 10 Mb for... (1 Reply)
Discussion started by: itian2010
1 Replies

6. Shell Programming and Scripting

To write a shell script which groups files with certain pattern, create a tar and zip

Hi Guru's, I have to write a shell script which groups file names based upon the certain matching string pattern, then creates the Tar file for that particular group of files and then zips the Tar file created for the respective group of files. For example, In the given directory these files... (3 Replies)
Discussion started by: rahu_sg
3 Replies

7. Shell Programming and Scripting

create diffrent files based on other file and parameters list

I would like ot create shell script/ bash to create diffrent files based on a file and parameters list. Here is the detail example: I have a textfile and four static parameter files (having ‘?'). mainfile.txt has below records (this count may be more than 50) A200001 A200101 B200001... (9 Replies)
Discussion started by: raghav525
9 Replies

8. Shell Programming and Scripting

shell script to remove old files and write to a log file

Hi, I have a script that works on a unix box but am trying to get it working on a linux box that uses shell. I am not a programmer so this is proving harder than I imagined. I made some changes and ended up with the script below but when I run it I get the following messages. Any help would be... (4 Replies)
Discussion started by: yabai
4 Replies

9. Shell Programming and Scripting

how to write shell scrit which adds parameters to existing files

Helo I have one file in that one filed is there RECLEN: 5 now I want to write a shell script which incresaes the value of RECLEN by 126 as well as I want to write shell script which adds CURPHONER:2:N:Phone used to call a record on which a recall is set PHONECNTR:2:N:Number of attemmpts... (3 Replies)
Discussion started by: amitpansuria
3 Replies

10. UNIX for Advanced & Expert Users

How to write Flat Files by shell script using Oracle Database

Hello There.. I came to a situation where I need to write flat files using shell scripts, I need to pull the records from the oracle database and create the flat file, This process should be automated. Can any shell script expert out here to help me.. please.. Will be really glad to... (3 Replies)
Discussion started by: coolbuddy
3 Replies
Login or Register to Ask a Question