03-09-2006
Thank you but I still did not understand how it takes up all files in the scripts directory. I will run this script in a directory where there are scripts files and I want to generate one single scripts files which generates back the scripts file into another directory but with certain parameter and file name different.
say the original directory has 6 scripts file named as
create_aaaaa
start_aaaaa
sopt_aaaaa
start_rc_aaaaa
stop_rc_aaaaa
also there are certain commands in the above files and other files whose name can be the same use aaaaa as a parameters. So, my need is create a sngle file as
echo " start_$1" >create_$1
echo " dis chl(q1.q2)" | runmqsc QM1 >>create_$1
The script file I am plannign to create has to create this single script file i explained above. It read files, add echo " takes line" > filename, if there is the parameter to change, it changes if not direct to the orignal file name
as >stoplsr
I mean this file name remains same in new directory too.
The single script file contans all the commands of all scripts files in the original script directory but paratemter changed. When I run this single script file inot new directory. similar set of files are created in the new directory but with part of file name different and some parameter name dirrerent inside some file name.
This script file has to take min 5 parameters to 10. Can these be put into a file and read as an input.
I maen, lets say out scrit to generate a single script file from a group of scripts file is generator. It has to take a file an an input where there are parameter
generator <inputfile
this generator, picks up all the scripts file one by one and generates a script file as
echo " command line, " > file name( may be start_$1)
the first part start_ is taken from the read file.
thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Folks!
I am a MacUser and am trying to learn Unix for the last few months.
I will explain in detail what I am trying to do, and apreciate you help if you can teach me even if it is a single comand line inside the script.
I own a small company, where I manufacture special gypsums and... (5 Replies)
Discussion started by: fundidor
5 Replies
2. Shell Programming and Scripting
Actually i am working with two diffrent files having same structure
each file contain Ten diffrent column and i want to write a script
which will compare the colummns of first file with the column of second file and diiference will be send to the first column of third file .
similarly for... (5 Replies)
Discussion started by: gyana_cboy
5 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I have done some BASIC shell scripting/PERL scripting before so I am familiar with the languages. I am not really sure which one would lend itself better to the application I have to write.
I am required to scan the message logs for possible break in attempts. If I use shell scripting... (2 Replies)
Discussion started by: mojoman
2 Replies
4. Shell Programming and Scripting
Hi All,
I have written the following script. I have just repeated some commands, and I am sure there is a more better way to do it. I hope I one of gurus here will help me make it in a better shape. Here is the script:
#! /bin/sh
sed -i -e "s/test2.xxx/test3.xxx/" -e "s/output2/output3/"... (2 Replies)
Discussion started by: faizlo
2 Replies
5. AIX
If I need delete some disk,
for i in hdisk1 hdisk2 hdisk3 hdisk4
do
rmdev -dl $i
done
if I have more than 100 hdisks, how to write a script like that to delete them? (6 Replies)
Discussion started by: rainbow_bean
6 Replies
6. Shell Programming and Scripting
Hi All,
I have written the follwing script to take the backup of the file every day
along with the date.
DATE=`date +%Y%m%d`
export DATE
cp var/hr/hr333m.txt cp var/hr/payments/hr333m_$DATE.txt
The file name as follows after taking the backup.
hr333m_20110630.txt
Could you... (3 Replies)
Discussion started by: ajaykumarkona
3 Replies
7. Shell Programming and Scripting
I am having a File format as mentioned below
Employee id|Name|Languages
12345|Hema|02|English|Hindi
4567|Basha|03|Engligh|Hindi|Telegu
the 02 and 03 are counters. Using that we need to generate the output records as mentioned below
12345|Hema|English
12345|Hema|Hindi
... (8 Replies)
Discussion started by: bashamsc
8 Replies
8. UNIX for Dummies Questions & Answers
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies
9. Shell Programming and Scripting
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies
10. UNIX for Beginners Questions & Answers
Hi All, need one help
Suppose there are two files-
1)Input files-:
path1/given/to/file | File1
path2/given/to/file | file 2
etc
Note- I use "|" as variable separator.
2) Target files-
I want to fetch data from file1 and use in below command-:
cd /path(from 1st file)
ls -ltr
If file(From... (2 Replies)
Discussion started by: Shubham
2 Replies
LEARN ABOUT DEBIAN
service
service(8) System Manager's Manual service(8)
NAME
service - run a System V init script
SYNOPSIS
service SCRIPT COMMAND [OPTIONS]
service --status-all
service --help | -h | --version
DESCRIPTION
service runs a System V init script in as predictable an environment as possible, removing most environment variables and with the current
working directory set to /.
The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the
invoked script. service passes COMMAND and OPTIONS to the init script unmodified. All scripts should support at least the start and stop
commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start com-
mand.
service --status-all runs all init scripts, in alphabetical order, with the status command.
EXIT CODES
service calls the init script and returns the status returned by it.
FILES
/etc/init.d
The directory containing System V init scripts.
ENVIRONMENT
LANG, TERM
The only environment variables passed to the init scripts.
SEE ALSO
/etc/init.d/skeleton,
update-rc.d(8),
init(8),
invoke-rc.d(8).
Jan 2006 service(8)