02-20-2007
I guess we can doit by:
1. shift for multiples of ten
or
2. Assign the arguments' list ($*) and using cut (though might fail in few cases)
Any better alternatives UNIX gurus?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have to create a global dynamic script which should ask for the env or some other variables and then create the soft links.
let's say that I have to create ten soft links and the path for these soft links is different for each env
for e.g:
WDEV: /d02/app/applmgr/wdev/appl/CDCRM/bin... (2 Replies)
Discussion started by: isingh786
2 Replies
2. Shell Programming and Scripting
Hi Gurus,
I have a requirement of writting the shell script where it should ask me two values
FND_TOP=/d02/app/oracle/xxx/fnd/11.5.0
CDCRM_TOP=/d02/app/oracle/xxx/cdcrm/11.5.0
and then keep these values stored as variables for the execution of rest of the script.
Because, I have to... (2 Replies)
Discussion started by: isingh786
2 Replies
3. UNIX for Advanced & Expert Users
I have a file that reads File (X.txt)
Contents of record 1:
rdrDESTINATION_ADDRESS (String) "91 971502573813"
rdrDESTINATION_IMSI (String) "000000000000000"
rdrORIGINATING_ADDRESS (String) "d0 movies"
rdrORIGINATING_IMSI (String) "000000000000000"
rdrTRAFFIC_EVENT_TIME... (0 Replies)
Discussion started by: magedfawzy
0 Replies
4. Shell Programming and Scripting
I need to run a shell script with dynamic command in it like
# Begin script...
mysql xx "select * from tab" | sed 's/\t/|/g' > GENERATED_20100304.txt
the dynamic part is 20100304 which should be today's date, and it needs to run every day and create a new file with... (2 Replies)
Discussion started by: nuthalapati
2 Replies
5. Shell Programming and Scripting
Hi All,
I am stuck in a situation where there is a script, say test1.tcsh which is being called from another script ,say test2.tcsh
test1.tcsh:-
#!/usr/local/bin/tcsh
echo -n "Do you wanna test ??"
set answ = $<
echo $answ
if ($answ =~ "y") then
echo -n "enter your name <"
... (1 Reply)
Discussion started by: kavyak
1 Replies
6. Shell Programming and Scripting
Hey there, first post, somewhat-long-time lurker-
This is on a Red Hat box
Im working on a new site, and I have an idea for a dynamic CGI script to change who is "on call"
Pretty much, it would pull next name from a text file each week to display it on the site, and just keeps cycling through... (3 Replies)
Discussion started by: rapenchukd
3 Replies
7. Shell Programming and Scripting
I am currently running 2 scripts to gather data for a 3rd script and would like to combine the 2 scripts into one. Having issues with the final output format.
Note cannot post URL so replaced the http stuff with (name) in the examples
All scripts contain #!/bin/ksh OS = Red Hat Enterprise... (0 Replies)
Discussion started by: pcpinkerton
0 Replies
8. HP-UX
Hi everyone, im try to write a small script to do something like this
new_find.sh#!/usr/bin/ksh
PAR=$1
PATH1=$2
find $PATH1 -name $PAR
i need to pass the mask of the find by parameter but this dont work
sh new_find *.sql /home/somthing
any tip ?
thanks! (3 Replies)
Discussion started by: lucasmanson
3 Replies
9. Shell Programming and Scripting
Hello friends,
I have a script.sh running, i need to move his generated file to another path and restart it every 24h.
is there a way to restart it from a script in a dynamic way without create a duplicate process?
script.sh &
mv file to /path
script.sh & many thanks for your help (7 Replies)
Discussion started by: kraterions
7 Replies
10. Shell Programming and Scripting
Dears,
#!/bin/bash
func1()
{
echo "func1"
}
func2()
{
echo "func2"
}
func3()
{
echo "func3"
} (5 Replies)
Discussion started by: sadique.manzar
5 Replies
LEARN ABOUT DEBIAN
hash_install
HASH(3pub) C Programmer's Manual HASH(3pub)
NAME
hash_create, hash_destroy, hash_install, hash_lookup, hash_uninstall, hash_iter - generic hash tables
SYNOPSIS
#include <publib.h>
Hashtab *hash_create(unsigned long (*fun)(void *),
int (*cmp)(const void *, const void *));
void hash_destroy(Hashtab *ht);
void *hash_install(Hashtab *ht, void *data, size_t size);
void *hash_lookup(Hashtab *ht, void *data);
int hash_uninstall(Hashtab *ht, void *data);
int hash_iter(Hashtab *ht, int (*doit)(void *, void *), void *param);
DESCRIPTION
These functions implement generic hash tables. The table is created by hash_create and destroyed by hash_destroy. The fun argument is a
pointer to the hashing function, which must convert a datum to an unsigned long, which is then converted to an index into the hashing ta-
ble. cmp is a qsort(3)-like comparison functions, used to compare to (wannabe) hash table elements.
hash_install installs a new datum into the table. A pointer to the data and the size of the data are given as the arguments. If the size
is 0, only the pointer value is copied to the table. Otherwise a copy of the data is made into dynamically allocated memory.
hash_lookup attempts to find a datum in the hash table. A pointer to another datum is given as the argument. The comparison function
should compare equal (return 0) the desired datum and this datum (but the argument needn't be a fully initialized datum, although that is
up to the writer of the comparison function). There cannot be two elements in the hash table that are equal (the comparison function
returns 0 for them). It is up to the user to handle collisions.
hash_uninstall removes an element from a table. The argument is a pointer to a datum that identifies the element.
hash_iter goes through every element in the hash table and calls the doit function for each. The first argument it provides to doit is the
element in question, the second is whatever was given to hash_iter as param. If doit returns -1 or 0 for any element in the hash table,
hash_iter immediately returns without going through the remaining elements in the hash table. Any other return value from doit is ignored.
RETURNS
hash_create returns a pointer to the new hash table, or NULL if it fails.
hash_install returns a pointer to an element in the table (either the installed one, or one that was already installed, if one tries to
install the same datum twice).
hash_uninstall returns 0 if it found the element in the array, or -1 if it didn't.
hash_lookup return a pointer to the element it finds, or NULL if it doesn't find anything beautiful.
hash_iter returns -1, 0, or 1. If hash_iter receives a return value of -1 or 0 for some element from doit, hash_iter immediately returns
-1 or 0, respectively. In all other cases hash_iter returns 1.
SEE ALSO
publib(3), qsort(3), bsearch(3)
AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual HASH(3pub)