Unique value added


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unique value added
# 1  
Old 05-18-2008
Unique value added

Guys,

I am trying to get unique numbers which i can use as a primary key in a table. I tried using the <seconds_since_epoch>.<hostname> combination but since more than one process can run on the same machine at the same time, this won't be unique either. Can anyone tell me another way to do this? Thanks.

Regards,
garric
# 2  
Old 05-18-2008
<seconds_since_epoch>.<hostname>.<pid>
# 3  
Old 05-18-2008
Thanks.. that works
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Added Two Arrays But With Errors

Please could someone have a look at the code below and spot the cause of the error. Thanks in advance. CODE BELOW: (code tags now added) My apologies please, that was my first time here.:) #! /bin/bash # file: whileloop.sh arr1=(2 4 6 8) arr2=(3 6 9 12) arr3=() indextotal=(${#arr1})... (4 Replies)
Discussion started by: Chiadi
4 Replies

2. Shell Programming and Scripting

Error after I added several lines

I have added several lines to my code let cnt=0 if then if then cnt=`expr ${cnt} + 1` sftp_name=EOMMSRPT1 echo "EOMsftpname = ${sftp_name}" >> ${LOGF} ... (2 Replies)
Discussion started by: digioleg54
2 Replies

3. Shell Programming and Scripting

Count occurrence of column one unique value having unique second column value

Hello Team, I need your help on the following: My input file a.txt is as below: 3330690|373846|108471 3330690|373846|108471 0640829|459725|100001 0640829|459725|100001 3330690|373847|108471 Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Discussion started by: angshuman
4 Replies

4. UNIX for Dummies Questions & Answers

Print unique lines without sort or unique

I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies

5. Red Hat

Static route not added

Hello Guys.. I am facing this weird problem of static route not added after reboot!! Following is my route-<interface> file.. # cat /etc/sysconfig/network-scripts/route-eth0 ADDRESS0=172.31.0.1 NETMASK0=255.255.255.255 GATEWAY0=192.168.208.1 ADDRESS1=172.31.15.2... (3 Replies)
Discussion started by: parth_buch
3 Replies

6. Shell Programming and Scripting

Change unique file names into new unique filenames

I have 84 files with the following names splitseqs.1, spliseqs.2 etc. and I want to change the .number to a unique filename. E.g. change splitseqs.1 into splitseqs.7114_1#24 and change spliseqs.2 into splitseqs.7067_2#4 So all the current file names are unique, so are the new file names.... (1 Reply)
Discussion started by: avonm
1 Replies

7. Shell Programming and Scripting

get part of file with unique & non-unique string

I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM". I can find the line number for the beginning of the statement section with sed. ... (5 Replies)
Discussion started by: andrewsc
5 Replies

8. UNIX for Dummies Questions & Answers

Routes being automatically added

Hello, I have two AIX 5.3 servers that are supposedly set up exactly the same. The problem I am having is on one of the servers, it seems dynamic routes are being added mysteriously and non-periodically. This only happens on one server and not the other. Also, there doesn't seem to be a specific... (1 Reply)
Discussion started by: Conutmonky
1 Replies

9. Programming

How come nothing is added to utmp in this case?

Given the following: #include <string.h> #include <stdlib.h> #include <pwd.h> #include <unistd.h> #include <utmp.h> #include <stdio.h> #include <time.h> int main(int argc, char *argv) { struct utmp entry; char *fd; system("echo before adding entry:;who"); ... (1 Reply)
Discussion started by: frequency8
1 Replies
Login or Register to Ask a Question