Saving variables to a .sh file and last successful run parm.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Saving variables to a .sh file and last successful run parm.
# 1  
Old 06-11-2013
Saving variables to a .sh file and last successful run parm.

I had a script that uses a fair number of variables. My manager just let me know that these variables have to be set in one .sh file. How do I do that? I'm use bash shell.

Also At the end of my script I need to save the last successful run. so that when I run it next time, I just this parm to pick up files.
I'm just the epoch. So I need to save that as a parameter to use next time.

How do i do this?
# 2  
Old 06-11-2013
You can define all your variables in a file and source that file.
# 3  
Old 06-11-2013
How do I source that file is what I am asking?
# 4  
Old 06-11-2013
Quote:
Originally Posted by MJCreations
How do I source that file is what I am asking?
Did you check the link that I posted?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ftp - file transfer and check successful delivery

In shell script, I want to transfer files continuously and make sure transfer is successful. Please advise... how to make sure ftp transfer is successful? Also is there any option such as sftp -b where I can pass multiple put <file name> commands to ftp Thanks! (1 Reply)
Discussion started by: vegasluxor
1 Replies

2. Shell Programming and Scripting

Using env variables to run a program

Hi there, I need urgent help with a small program that is run via shell script. Unfortunately I only understand the bare basics of shell scripting and can't figure out how to do this. We have a program that tests the connection between 3 servers. I have a script that lets the program run on... (15 Replies)
Discussion started by: Pherdinand
15 Replies

3. Shell Programming and Scripting

Compare File & Copy Replace if Successful

Hi All, I have written a shell script that creates a backup of my MySQL database. The script performs the following functions: Creates a Backup of the MySQL database Compresses the Backup Copies the Backup to a Remote Server Send an E-Mail displaying the size of the Backup Removes any... (6 Replies)
Discussion started by: SalientAnimal
6 Replies

4. Shell Programming and Scripting

saving all input name and store them as variables

Hi I want to write a script such that when executed, it will store all input as different variable, for eg ./store.sh name1 name2 name3 name4 will result in $1=name1 $2=name2 $3=name3 etc How do I do that? Thanks. (1 Reply)
Discussion started by: piynik
1 Replies

5. Shell Programming and Scripting

Delete File Only If Successful Transfer..

Hi. I have this shell script for ftp.. ftp -n 12.34.5.67 << EOF user username password cd LOCAL/inbox bin get JAN_Total.gz # del JAN_Total.gz EOF how do i modify the commented part i.e. del JAN_Total.gz only if that JAN_Total.gz has been successfully transfered to the local... (8 Replies)
Discussion started by: aimy
8 Replies

6. Shell Programming and Scripting

Passing the value of Out parm in SP to UNIX Shell Script

I have a simple procedure which accepts two input parms and returns and output count: CREATE OR REPLACE Procedure GET1 ( IN_FOLDER IN VARCHAR2, IN_SUBJECT_AREA IN VARCHAR2, OUT_CNT IN OUT VARCHAR2 ) AS BEGIN ... (2 Replies)
Discussion started by: Hangman2
2 Replies

7. Shell Programming and Scripting

pass runtime parm to at -f shell script

Hi Folks... I am using a ksh script to submit the at command to run a shell script for immediate execution. The shell script requries 1 parameter. Command in the script is at -m -f $EXE_DIR/process_server.sh $START_TIME $DB_NAME where START_TIME=now and DB_NAME= tnsname of Oracle... (1 Reply)
Discussion started by: island360
1 Replies

8. Shell Programming and Scripting

cron job problem, passing a parm

Hi, I have an existing cron job like the following. 15 5 * * * /appl/scripts/MyScript.sh 2>/dev/null >/dev/null and this works just fine. Now I had to modify the script and now it requires an input parm as 2. I had modified the cron entry so that the script can run now with the... (12 Replies)
Discussion started by: bheemsen
12 Replies

9. UNIX for Dummies Questions & Answers

backing up file everytime script run and saving other backups

how would i go about creatng a backup of a file everytime a script is run so that the next time it is run the old backup gets pushed back and the most recent backup is 1st. (new)backup.1 (old)backup.2 that kind of idea?? (4 Replies)
Discussion started by: knc9233
4 Replies

10. Shell Programming and Scripting

Script to submit a job with date parm in maestro

I'm a newbie in scripting attempting to create a script where i can submit a job (in maestro/tivoli) with parameters,in maestro CLI i can do that no problem,i'm thinking about creating a script that will accept input while the script is executing, more like below structure: exec the script -... (1 Reply)
Discussion started by: Kirojin
1 Replies
Login or Register to Ask a Question