10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys,
I have created a script for our automated DB creation, it works fine with default option(-d).
$ ./test_db.ksh -d abc 11 dev
-d is Default option
ORACLE_SID=abc
ORACLE_VERSION=11
ENV_TYPE=dev
For creating a customized DB, i thought of giving the user different options.... (8 Replies)
Discussion started by: veeresh_15
8 Replies
2. Shell Programming and Scripting
I have a huge file semicolon( ; ) separated records are Pipe(|) delimited.
e.g
abc;def;ghi|jkl;mno;pqr|123;456;789
I need to replace the 50th field(semicolon separated) of each record with 9006. The 50th field can have no value e.g. ;;
Can someone help me with the appropriate command. (3 Replies)
Discussion started by: Gurkamal83
3 Replies
3. Shell Programming and Scripting
How can I say one of the options is required? can I use an if statement?
let say:
while getopts ":c:u:fp" opt; do
case $opt in
c) echo "-c was triggered, Parameter: $OPTARG" >&2;;
u) echo "-u was triggered, Parameter: $OPTARG" >&2;;
f) echo "-u was triggered,... (2 Replies)
Discussion started by: bashily
2 Replies
4. Shell Programming and Scripting
Hello All,
I have shell script as below in a.ksh.
#! /usr/bin/ksh
while getopts a: b: ab:f: VAR
do
case $VAR in
a) A=${OPTARG}
echo $A;;
b) B=${OPTARG}
echo $B;;
ab) AB=${OPTARG}
echo $AB ;;
f) F=${OPTARG}
echo $F ;;
esac
done
When I execute sh a.ksh -a 1 -b 2 -ab 3 -f 4 as below... (7 Replies)
Discussion started by: tonsat
7 Replies
5. Shell Programming and Scripting
I have been doing automation of daily check activity for a server, i have been using sqls to retrive the data and while loop for reading the data from the file for several activities. BUT i got a show stopper the below one.. where the data is getting store in $temp_file, but not being read by while... (1 Reply)
Discussion started by: KuldeepSinghTCS
1 Replies
6. Shell Programming and Scripting
hai all
I am new to the world of shell scripting
I wanted to extract two columns from multiple files say around 25 files
and i wanted to get the separate outfile for each input file
tired using the following command to extract two columns from 25 files
awk... (2 Replies)
Discussion started by: hema dhevi
2 Replies
7. UNIX for Dummies Questions & Answers
Hi all,
I have a requirement here where I am dealing with a dynamic file. Each record in the file can contain anywhere between 1(min) to 42(max) Reject codes. For example I may have one record in the file having 3 reject codes and another record having 5 reject codes. The reject codes will be... (2 Replies)
Discussion started by: sujainarayan
2 Replies
8. Shell Programming and Scripting
Hi ,
Is there any way to achieve following using perl program (i.e without using system command).
1.system ("echo 'test' > /usr/spool/ship.csv");
2.system ("cat /usr/ajay_test* >> /usr/spool/RAM/work/patil.csv");
3.system("> /usr/spool/ajay.txt");
e.g
for system("rm -f... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies
9. UNIX for Dummies Questions & Answers
Hi, I'm having problems with a script where I wanted every single option specified in the command line to have an argument taken with it, but for some reason only d works in the code I will be showing below.
For example if I did ./thisfile -a something
it would come up with "a chosen with " as... (2 Replies)
Discussion started by: IceX
2 Replies
10. UNIX for Dummies Questions & Answers
Hi All,
I want to read a file in UNIX line by line.
Can u suggest me any command for this? (4 Replies)
Discussion started by: VENC22
4 Replies