03-14-2006
I wanted to update a script, more dynamic (just say no to hard coding)...
currently it has the following:
bdumpN=`ll /home/apps/oracle/admin/DBprod/bdump/DBprod_j* | grep "$Cdate" | wc -l`
If I pass the DBname, I would not have to hardcode it in the script...
I can capture the database name by adding the following:
DBname=$1
The problem is, I have been unable to get the listing to work properly (the following do not work):
bdumpN=`ll /home/apps/oracle/admin/$DBname/bdump/$DBname_j* | wc -l`
and tried
bdumpN=`ll /home/apps/oracle/admin/$DBname/bdump/$DBname"_j*" | wc -l`
Both do not return the correct DBprod_j* files...
If I run the command in-line, I get the following:
# ll /home/apps/oracle/admin/DBprod/bdump/DBprod_j* | wc -l
8
here is a list of files:
-rw-r--r-- 1 oracle dba 24716 Mar 4 06:01 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_10115.trc
-rw-r--r-- 1 oracle dba 24917 Mar 8 06:01 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_13643.trc
-rw-r--r-- 1 oracle dba 25099 Mar 9 06:01 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_14782.trc
-rw-r--r-- 1 oracle dba 25237 Mar 11 06:01 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_16386.trc
-rw-r--r-- 1 oracle dba 1090 Mar 9 18:34 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_21193.trc
-rw-r--r-- 1 oracle dba 25196 Mar 10 07:46 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_29055.trc
-rw-r--r-- 1 oracle dba 24915 Mar 7 08:25 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_29819.trc
-rw-r--r-- 1 oracle dba 23426 Mar 6 00:00 /home/apps/oracle/admin/DBprod/bdump/DBprod_j001_10244.trc
thanks,
manny
8 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
hi,
i have some files which r link to the directory
and to refer these files there is a html link on my web page
At the moment there are only 2 active links. I created a soft link to the original source at very first time, the owner of these documents can change the content and update... (1 Reply)
Discussion started by: sushil_d10
1 Replies
2. Shell Programming and Scripting
Hello Guys,
I'm new to Shell scripting, and i need someone to help me with this issue:
I'm trying to do a dynamic update query on Sysbase database table using shell script.
Lets say, the Update query is "update Table set id=X" , where X is dynamic value for the loop index.
If the loop is... (10 Replies)
Discussion started by: Alaeddin
10 Replies
3. UNIX for Dummies Questions & Answers
Hi
Can any one help me out ?
I am trying to send an autogenerated mail with an attachment to bulk of users using 'MAILX' and 'UNENCODE' . I have used it as follows
X " ( cat /sastemp/body.txt; uuencode Test.xls.gz Test.xls.gz ) | mailx -s 'Testing' ' abcd@yahoo.com , efgh@gmail.com ' "
... (9 Replies)
Discussion started by: manas6
9 Replies
4. Programming
This might be a silly question, but I thought I'd ask anyway. If I'm writing in C, isn't it more efficient to, for instance, use constant character variable set to 'A' instead of hard-coding a character 'A'? Since it's only a single character instead of a string, it might not matter much. (10 Replies)
Discussion started by: cleopard
10 Replies
5. Shell Programming and Scripting
hi ,
i am writing a script to copy the MQ messages from onw queue to another. The following i got from one site, but i di not understand , can anyone explain.
/root/scripts/sap/q -m$Q_MANAGER -i$Q_NAME_SRC_1 -F/logs/mq/MQ_COPYdump_$Q_NAME_SRC_1.$$
/root/scripts/sap/q -m$Q_MANAGER... (0 Replies)
Discussion started by: Satyak
0 Replies
6. Shell Programming and Scripting
If your Unix box doesn't support bash scripts then do not do the following.
Create a file named version. type chmod 755 version and then copy and paste the code below into the file. Then type "mv version /bin" and presto, type version. A cool full hearty command. If you know more about you're Os... (3 Replies)
Discussion started by: Errigour
3 Replies
7. Shell Programming and Scripting
Hi All,
I am newbie here and request your assistance.
I have a service running on public ip, but since I have a dynamic IP it keeps on changing and every time I need to manually get the new ip and add to the config file and restart the service. This has become bit time consuming.
Hence, I... (4 Replies)
Discussion started by: Shaan_Shaan
4 Replies
8. Web Development
Hi,
I would like to read content from a https site.
I have decided to use LWP module in perl. but it throwed 401 Authorization required error.
i dont want to hard code the password in my perl code. Is there any way to achieve the authentication without hardcoding the password.
Thanks,... (1 Reply)
Discussion started by: pandeesh
1 Replies
CHING(6) Games Manual CHING(6)
NAME
ching - the book of changes and other cookies
SYNOPSIS
/usr/games/ching [ hexagram ]
DESCRIPTION
The I Ching or Book of Changes is an ancient Chinese oracle that has been in use for centuries as a source of wisdom and advice.
The text of the oracle (as it is sometimes known) consists of sixty-four hexagrams, each symbolized by a particular arrangement of six
straight (---) and broken (- -) lines. These lines have values ranging from six through nine, with the even values indicating the broken
lines.
Each hexagram consists of two major sections. The Judgement relates specifically to the matter at hand (E.g., "It furthers one to have
somewhere to go.") while the Image describes the general attributes of the hexagram and how they apply to one's own life ("Thus the supe-
rior man makes himself strong and untiring.").
When any of the lines have the values six or nine, they are moving lines; for each there is an appended judgement which becomes signifi-
cant. Furthermore, the moving lines are inherently unstable and change into their opposites; a second hexagram (and thus an additional
judgement) is formed.
Normally, one consults the oracle by fixing the desired question firmly in mind and then casting a set of changes (lines) using
yarrow-stalks or tossed coins. The resulting hexagram will be the answer to the question.
Using an algorithm suggested by S. C. Johnson, the UNIX oracle simply reads a question from the standard input (up to an EOF) and hashes
the individual characters in combination with the time of day, process id and any other magic numbers which happen to be lying around the
system. The resulting value is used as the seed of a random number generator which drives a simulated coin-toss divination. The answer is
then piped through nroff for formatting and will appear on the standard output.
For those who wish to remain steadfast in the old traditions, the oracle will also accept the results of a personal divination using, for
example, coins. To do this, cast the change and then type the resulting line values as an argument.
The impatient modern may prefer to settle for Chinese cookies; try fortune(6).
SEE ALSO
It furthers one to see the great man.
DIAGNOSTICS
The great prince issues commands,
Founds states, vests families with fiefs.
Inferior people should not be employed.
BUGS
Waiting in the mud
Brings about the arrival of the enemy.
If one is not extremely careful,
Somebody may come up from behind and strike him.
Misfortune.
7th Edition May 20, 1985 CHING(6)