shell script to create dirs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script to create dirs
# 1  
Old 07-24-2007
shell script to create dirs

hi,

I would like to know of a shell script to create the following

A script which will take in two parameters i.e. name of file and SID and create directories named /opt/oracle/admin/$SID/{bdump,cdump,udump}. Then edit the init file and change the three lines that look like this.

background_dump_dest = "/opt/oracle/oradata/shared/odvetr2x/bdump"
core_dump_dest = "/opt/oracle/oradata/shared/odvetr2x/cdump"
user_dump_dest = "/opt/oracle/oradata/shared/odvetr2x/udump"

Make them point to the three directories that were created.
# 2  
Old 07-24-2007
Could you please add more information?

So you would want to give two arguments first a file name and second a SID which is used to create the 3 directories like (/opt/oracle/admin/ $SID/bdump, /opt/oracle/admin/$SID/cdump, /opt/oracle/admin/$SID/udump)
But where is that file name being used?

You have metioned to edit the init file for three variables and does this part "/opt/oracle/oradata/shared/odvetr2x/" is static. Or should we update the init file like

background_dump_dest = "/opt/oracle/admin/$SID/bdump"

If possible provide us with examples
# 3  
Old 07-24-2007
use it
Code:
echo "enter file name"
read file_name
mkdir ${file_name}"_bdump"
mkdir ${file_name}"_cdump"
mkdir ${file_name}"_udump"

As lorcan said ,can you provide more details...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Iterate over `dirs` in a bash script

I would like to iterate over `dirs`in a script, but the script will never show more than one (current) folder #! /bin/bash for i in `dirs` do echo ${i} done echo ++++++++++++++++++ for i in $( dirs -p ) do echo ${i} done echo ------------------ dirscontent=`dirs` echo... (5 Replies)
Discussion started by: alexanderb
5 Replies

2. 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

3. Shell Programming and Scripting

Not correct processing of “\ “ in names of dirs inside shell script (tar command - system backup scr

Hello, Recently, I've started with shell scripting, and decided to write a script for my system backup using tar. When I was dealing with tar execution inside shell script I found this, inside shell we have the following code: tar $TAR_PARAMS $ARCHIVE_FILE $EXCLUDE $BACKUP_STARTwith... (6 Replies)
Discussion started by: ilnar
6 Replies

4. Shell Programming and Scripting

Create Shell Script

Create a script to do the following : a. Poll for ctl file abc.ctl b. if the ctl file is found, then check for corresponding dat file(abc.dat) c. if dat file is not found then fail the process e. if dat file is found do file validation File Validation: a. Check the... (1 Reply)
Discussion started by: vivek1489
1 Replies

5. Shell Programming and Scripting

Launching shell scripts from different dirs

Hi, General question, if I have a shell script whcih I launch from anywhere on the system vis the PATH env var, how can I get the script to echo where I launch this from? i.e. /my/home/script/myscript BUT I launch this from /my/otherarea/somewherelse via the env variable. I would... (1 Reply)
Discussion started by: cyberfrog
1 Replies

6. Shell Programming and Scripting

To Create shell script files from a shell script

Dear Unix and Linux users, Good evening to all. I'm new to this community and thank you for having an wonderful forum. Dear members i had to create almost some 300 shell script files for a particular task. I tried something like this.... #!usr/bin/sh fname=epdb_jobs for x in `cat $fname`... (3 Replies)
Discussion started by: NehaB
3 Replies

7. Shell Programming and Scripting

Need help to create shell script.

When i run the following command it shows me following o/p # prtpicl -v -c temperature-sensor | sed -n '/T_TCORE/,/:name/ p' | grep Temperature 61 Temperature 62 i want to put this command in shell script so that when i run the script it says ********************* Proc1 ... (4 Replies)
Discussion started by: fugitive
4 Replies

8. Shell Programming and Scripting

script find files in two dirs HELP

I have a directory which is /home/mark/files/ , inside this particular I have a bunch of filles (see examples below) TST_SHU_00014460_20090302.txt TST_SHU_00016047_20090302.txt TST_SHU_00007838_20090303.txt TST_SHU_00056485_20090303.txt TST_SHU_00014460_20090303.txt... (2 Replies)
Discussion started by: fierusbentus
2 Replies

9. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies

10. Shell Programming and Scripting

create a shell script

create a shell script that process a file file contain f2f_100.txt 1234 kkk 12345 f2f_101.txt 1234 mmm 11111 retire_200.txt 2222 rrr 22222 retire_201.txt 1112 qqr 12122 output needed if first field is f2f then new file fb_$1 contain $2|$4 ... (3 Replies)
Discussion started by: maykap100
3 Replies
Login or Register to Ask a Question