Write script to call a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Write script to call a file
# 1  
Old 10-26-2010
Write script to call a file

Hello Experts,

I have been trying to work on to call a file in scripts.
Code:
@ECHO OFF
call %MY_HOME%\bin\setvars.bat
call %MY_HOME%\db\bin\start_db.bat.

This is a batch file and i want to write same functionality in shell script. How should I achieve it? How should I set variables in a script? I am not that much in linux and unix. I would like to know the mechanism though. Please share your ideas and suggestions. Thank you in advance.

Best regards.

Moderator's Comments:
Mod Comment Use [code] and [/code] tags when posting code, data or logs etc. thanks. You got a PM with a guide.

Last edited by zaxxon; 10-26-2010 at 06:19 AM..
# 2  
Old 10-26-2010
Code:
.  $HOME/bin/set_vars.sh  # NOTE the preceeding dot and a space
$HOME/bin/start_db.sh

I don't think you want to stop echoing in UNIX shell, it is not exactly the same in UNIX
If you did you can redirect each command to "echo" into the bit bucket:
Code:
. $HOME/bin/set_vars.sh > /dev/null
$HOME/bin/start_db.sh >/dev/null


The other .bat files have to also be rewritten in shell also....
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 call sql file

hi , the below script contains sql query and after executed it sends the output of the query (output.txt) to an email body with conditional subject line based on the output of all_counts_match.txt. i want to make this script generic so that it can accept the sql file as parameter and can... (5 Replies)
Discussion started by: itzkashi
5 Replies

2. Shell Programming and Scripting

Need help to write to log file whether the shell script call pass fail

I have the below script triggered daily at 330am in the morning, since last 7 days job not writing anything to database. below impala shell calling shell file which has sql , it is extracting data and loads to a flat file txt file. which is going wrong for last 1 week. need help, echo... (2 Replies)
Discussion started by: cplusplus1
2 Replies

3. Shell Programming and Scripting

Need to write shell script for my .sql file call

Hi Guys, I need to write a simple shell script which will generate a .csv file/report by calling .sql file inside a shell script. Can somebody help me on this. Thanks in advance! Regards, LK (7 Replies)
Discussion started by: lakshmanraok117
7 Replies

4. Shell Programming and Scripting

Call a Perl script within a bash script and store the ouput in a .txt file

I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients). I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
Discussion started by: mecaka
6 Replies

5. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

6. Shell Programming and Scripting

Script to call a menu script and redirect each option to a text file

Hello, I want to design a script that will call an existing menu script and select options one by one and redirict the out put to a file. For example;- In the script MENU.sh there are 10 options i want to design a script MENU2.sh that will select option 2 3 4 6 7 10 and redirict the output... (4 Replies)
Discussion started by: spradha
4 Replies

7. Shell Programming and Scripting

How to call mail id from different file in shell script?

Hi Team, Please can anyone tell me how to call mail ids from different file in shell script. For Example: ========= export MAILX=/bin/mailx export MAIL_DBA=xxx@gmail.com,yyy@gmail.com,zzz@gmail.com sendalertmess() { MESSAGE="ALARM" echo $MESSAGE | MAILX -s "uname -n :Oracle error"... (3 Replies)
Discussion started by: indira_s
3 Replies

8. Shell Programming and Scripting

script to call a line from a file

Hi All, I have a file which list lines, say, line.txt The file line.txt says, foreach LINE ( 100 200 300 400 ) and I have a script file which need to run for all the lines above individually. now I want to make a file which can call the line from line.txt and run script for that line... (0 Replies)
Discussion started by: Indra2011
0 Replies

9. UNIX for Dummies Questions & Answers

write() system call arguments

Hi, I'm trying to understand the arguments from this system call, can someone help me figure it out? write(1, "/home/nick/11sp/fred\n", 27/home/nick/11sp/fred) = 27 for argument 1, i know it is a file descriptor which specifies standard output. Argument 2, i believe is "what is to be... (4 Replies)
Discussion started by: l flipboi l
4 Replies

10. Shell Programming and Scripting

call a passwd file to a script multiple times

Hello everybody, I have a requirement in my script.. When i'am executing a script, it'll ask a passwd of some service account.. I need to pass it to the script through a zipped file when it asks for it. The script can be executed by more people many number times. So for securty purpose, it... (1 Reply)
Discussion started by: raghu.iv85
1 Replies
Login or Register to Ask a Question