How to preserve the value of a variable from being overwritten?
Hi All,
I am new new to unix.com, I have a question related to shell scripting.
We have a Oracle database backup shell script, which can be used for taking full, incremental & archive log backup based on the parameters passed.
Within the script we export a variable as
So for every execution of backup, we will have a unique gv_shell_id. We store the gv_shell_id along with other backup details in a database table for reporting purpose.
If we have executed a full backup, it will set a gv_shell_id and if simultaneously some one kicks off archive log backup, it will reset the gv_shell_id with different value.
And this is causing a wrong entry of gv_shell_id for full backup in the table.
Basically i want to make the variable itself unique for every execution to avoid such problem.
I tried using gv_shell_id_$$=$(date "+%y%m%d_%H%M%S_")$$
but it throws below error.
Can you please help me in generating a unique variable so that it doesn't get overwirtten by any other execution of same script.
Last edited by Scott; 07-12-2014 at 09:37 AM..
Reason: Please use code tags
Hi, My account is : abcd
I belong to a group: pqrs
Some thing straneg happened yesterday.
My .cshrc and .login got overwritten into pqrs's .cshrc and .login
I obviously did not explicitly overwrite pqrs's .cshrc.
Are there any reasons how this could have happened indirectly due to... (5 Replies)
Hello,
One of my frend had a problem.
He had Windows XP installed on his system. Then he installed Red Hat Linux 8.0 in one of the partitions. After some time his XP got corrupt and then he reinstalled Windows XP. This over wrote the Grub loader entry, and due to this the grub loader is not... (2 Replies)
We have a problem where we delete a user and their associated UID gets dumped back in the UID pool. The if we immediately create a another (new) user, AIX reuses the last UID, the one that was just released. This is causing a problem when reports are being generated because the new users name is... (2 Replies)
The following files were wiped out - new empty files were left in their place.
/etc/inittab, /etc/inetd.conf, and /etc/MANPATH
The system is running HP-UX 11i v3 - Mar08.
Anyone seen anything like this?
Any ideas on a way to figure this out if it happens again or a suggested way to... (9 Replies)
Hi,
The dump device on my system was set to /dev/dsk/c0t0d0s7. I have done a savecore -Lv on the system which worked fine. I'm wondering have I overwritten the rootdisk here by mistake? The system is still up but will need to be rebooted due to an error on it. Will it come back up?
... (8 Replies)
Hi, i have some problems with the following code:
char *tab_path;
char *sep=" \t\n";
char line;
char *p;
FILE * file;
int i = 0;
if(fgets(line,MAXLINE,file)!=NULL){
if((p=strtok(line,sep))!=NULL)tab_path=p;
while((p=strtok(NULL,sep))!=NULL){
i++;
... (4 Replies)
Hello All,
I am writing a bash script on Solaris O/S. I looping through an array. For each iteration, i connect to the datatabase and use select statement. Output of which is redirected to .CSV file. here is the code for it.
output="loop.csv"
elements=${#currency_pair}
... (3 Replies)
This seems to be a stupid basic question, but I cant get the space to stick in the awk variable.
I do use this command to grep a time range of the log file.
cat /var/log/daemon.log | awk '$0>=from&&$0<=to' from="$(date +%b" "%e" "%H:%M:%S -d -24hour)" to="$(date +%b" "%e" "%H:%M:%S)"
I now... (9 Replies)
Hello,
I wondering how I can echo a string without having the trailing whitespace removed.
For example I have a string str="TESTING123 " that I need to hash using sha1. I get the correct answer when I run the line below from the terminal
$ echo -n "TESTING123 " | openssl sha1... (3 Replies)
I had generated a ssh2 key on my AIX box, to receive files from other AIX and Linux systems.
Key Name: id_ssh2_server.pub
However this ssh2 key (both public and private keys) has been overwritten, while I was generating another ssh2 key. Now the earlier configured target systems are not able... (3 Replies)