08-13-2009
Passing info from other file into command
I created file called "tape_name" which contains
tape_mon_A="TAPE_MON_A"
tape_tue_A="TAPE_TUE_A"
tape_wed_A="TAPE_WED_A"
tape_thr_A="TAPE_THR_A"
tape_mon_B="TAPE_MON_B"
tape_tue_B="TAPE_TUE_B"
tape_wed_B="TAPE_WED_B"
tape_thr_B="TAPE_THR_B"
I created test script as follow
#!/bin/sh
TAPE_LOC="location/of/the/above/file"
. /$TAPE_LOC/tape_name
echo "$tape_mon_A"
echo "$tape_tue_A"
when I run above script it returnes
TAPE_MON_A
TAPE_TUE_A
=============
Question is I don't want to hard code omnib command with tape name since it changes frequently.
my regular tape_name hardcoded commands run without any problem
sudo -u root /usr/bin/rsh domain.server.com "/opt/omni/bin/omnib -datalist TUE_TAPE-TST -mode full -load high
but when I changed TUE_TAPE-TST to $TAPE_BACKUP variable the command is not working.
Is there way to make TUE_TAPE-TST to accept variable parameter as I tried on test script?
thank you
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
one of my colleagues has this question.
he has a command, C_CMD which accepts 4 variables, $1 $2 $3 $4
he wants to load up a file with multiple rows, one row per set of variables and then iteratively execute the command based on the content of the file.
example:
at the command line you'd... (5 Replies)
Discussion started by: LisaS
5 Replies
2. Shell Programming and Scripting
I have a bash script which utilizes a random function and then runs a file at now plus a random time.
The problem is, that the php file requires a parameter after it eg:
phpfile.php?code=123245b3
When i put in the file including the full path, with the at command, it will run, but not with... (1 Reply)
Discussion started by: thruxmore
1 Replies
3. Shell Programming and Scripting
I have an input file with contents like:
MainFile.dat:
12247689|7896|77698080
16768900|hh78|78959390
12247689|7896|77698080
16768900|hh78|78959390
12247689|7896|77698080
16768900|hh78|78959390
12247689|7896|77698080
16768900|hh78|78959390
12247689|7896|77698080
16768900|hh78|78959390
... (4 Replies)
Discussion started by: rkrish
4 Replies
4. UNIX for Dummies Questions & Answers
HI Guys,
I hope you are well. I am trying to write a script that gets executed every time i open a shell (cshell). I have two questions about that
1) I need to enter these commands
$ echo $DISPLAY
$ setenv $DISPLAY output_of_echo_$display_command
How can i write a... (2 Replies)
Discussion started by: kaaliakahn
2 Replies
5. Shell Programming and Scripting
My intention is to log the output to a file as well as it should be displayed on the console > I have used tee ( tee -a ${filename} ) command for this purpose. This is working as expected for first few outputs, after some event loggin nothing is gettting logged in to the file but It is displaying... (3 Replies)
Discussion started by: sanoop
3 Replies
6. UNIX for Dummies Questions & Answers
Hi
Im trying to run zip shell command from an Oracle job, but this has limitations.
This should take a few of explanaition,..
Oracle allows me to execute a command and then I can set up a fixed number of arguments. Ex: (summarizing in something like..):
JOB DEFINITION
job_name: test... (4 Replies)
Discussion started by: vegatripy
4 Replies
7. Shell Programming and Scripting
I need to be able to take the results from ls -l command and modify the output as follows:
I will run
ls -l *.mak
My results will be
aa.mak
bb.mak
cc.mak
I then need to take those results and create a file that has the following info:
dsjj/ubin/aa
dsjj/ubin/bb
dsjj/ubin/cc
... (3 Replies)
Discussion started by: jclanc8
3 Replies
8. Shell Programming and Scripting
I have a file example.txt as follows :SomeTextGoesHere
$$TODAY_DT=20140818
$$TODAY_DT=20140818
$$TODAY_DT=20140818I need to automatically update the date (20140818) in the above file, by getting the new date as argument, using a shell script.
(It would even be better if I could pass... (5 Replies)
Discussion started by: SriRamKrish
5 Replies
9. Shell Programming and Scripting
Hi all,
I have a file looks like
AAAA 111
BBBB 222
CCCC 333
need to pass variable value like var1=AAAA and var2=111
to another command for three times with next values.
stuck over here
cat file | while read line
do
export var1=`awk '{print $1}'`
echo $var1
export var2=`cat file... (3 Replies)
Discussion started by: rakeshtomar82
3 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I am having command to run which will take argument as input file. Right now we are creating the input file by cat and executing the command
ftptransfer -i input file
cat >input file
file1
file2
cntrl +d
Is there a way I can do that in a single command like
... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
INFO(5) File Formats Manual INFO(5)
NAME
info - readable online documentation
DESCRIPTION
The Info file format is an easily-parsable representation for online documents. It can be read by emacs(1) and info(1) among other pro-
grams.
Info files are usually created from texinfo(5) sources by makeinfo(1), but can be created from scratch if so desired.
For a full description of the Texinfo language and associated tools, please see the Texinfo manual (written in Texinfo itself). Most
likely, running this command from your shell:
info texinfo
or this key sequence from inside Emacs:
M-x info RET m texinfo RET
will get you there.
AVAILABILITY
ftp://ftp.gnu.org/pub/gnu/texinfo-<version>.tar.gz
or any GNU mirror site.
REPORTING BUGS
Please send bug reports to bug-texinfo@gnu.org, general questions and discussion to help-texinfo@gnu.org.
SEE ALSO
info(1), install-info(1), makeinfo(1), texi2dvi(1),
texindex(1).
emacs(1), tex(1).
texinfo(5).
FSF
GNU Info INFO(5)