12-14-2007
How to pass values from one file to different scripts
Hi Gurus,
Iam new to Unix.
I had a requirement where i should use a file for example
Host.sh or Host.txt
Host = 555.254.45.14
username = aaaa
pwd = SSSSSS123
And this file need to be used in different scripts.
For example i have script1.sh
where i want to use the values of Host,username & pwd to connect
and similarly in other scripts like script2.sh and script3.sh
So, please provide any example scripts or other info
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear friends,
please tell me how to pass the external variable values to the nawk command.
length=`expr $len2 - $len1`
i need to pass $length to following nawk command as mentioned below.
nawk '{if((x=index($0,"W/X"))>0){id=substr($0,x, $length);print x;print id;}}' filename1
but I am... (1 Reply)
Discussion started by: swamymns
1 Replies
2. Shell Programming and Scripting
I'm finding the following command very tedious to type in all the time, so I created a one line bash script called mount.bash with the following contents:
mount -t cifs //mark/C\$ -o unc=//mark\\C$,ip=10.1.1.33,user=Administrator,password=$1 /mnt/mark
I don't like the fact that I have to put... (5 Replies)
Discussion started by: siegfried
5 Replies
3. Shell Programming and Scripting
Hi one & All ,
My Need is to Create 64 Partition and create File System in Linux.
I have the Script ...
for((a=0;a<=63;a++))
do
fdisk /dev/cciss/c0d$a
done
for((a=0;a<=63;a++))
do
mkfs.ext2 /dec/cciss/'c0d'$a'p1'
done
the moment I run the Script I get the Prompt ...
Command... (1 Reply)
Discussion started by: nix-kid
1 Replies
4. Shell Programming and Scripting
only the arguments that are written to the file,
my script is (sh /u01app/wkf.sh"$start_no","$name","$Condition","$file_name") like that
when ever I run my script I need to write into a new file every time,
like wise I have upto10 files with different names.bec my $start_no and $name will... (1 Reply)
Discussion started by: sai123
1 Replies
5. Shell Programming and Scripting
I know that we can call system command to execute shell script in awk.
but it does not return the result of the command executed , but only returns
the value of the command executoin status ( 1/0 --> failure / success).
Could anyone let me know how to solve this problem. (9 Replies)
Discussion started by: rajnikanth.1912
9 Replies
6. Shell Programming and Scripting
Hi All,
Can anybody please help me with how can i call my java program from shell and also pass parameter along with it so that the program can interpret the value/int and update the database.
Thanks in advance
Neha (1 Reply)
Discussion started by: Neha Goyal
1 Replies
7. Shell Programming and Scripting
I use csh a lot but I don't really write csh scripts. Now I have a need to implement a security check (written in perl; verify an user input security code) into a csh script. Here is the senario:
#csh
1. call the perl script
2. if the perl script returns 'true', pass on;
if the perl... (1 Reply)
Discussion started by: Julian16
1 Replies
8. Shell Programming and Scripting
Hello, I have two bash scripts like the following:
script 1:
#!/bin/bash
var=WORLD
bash path/to/second/script/script2.bash
script 2:
#!/bin/bash
echo "HELLO $var"
I expected the output to be "HELLO WORLD" but instead, I get "HELLO". I understand that when I envoke another bash... (2 Replies)
Discussion started by: jl487
2 Replies
9. Shell Programming and Scripting
Dears,
Need help to implement below requirement
A file (detail.txt)contain :
1st column: Stream
2nd column: PathAddress
3rd column: Counterlimit
4th column: TransactionDateColumn
5th column: DateType
6th column: SleepValue
7th column: Status
Need to write a... (1 Reply)
Discussion started by: sadique.manzar
1 Replies
10. Shell Programming and Scripting
Hello.
A find command return a list of file.
For each fileReplace the content starting with the first "§" (of two) ending with last "ɸ" (of two), regardless of the content ( five lines )
by the following content (exactly) :
§2019_08_23§ #
# ... (8 Replies)
Discussion started by: jcdole
8 Replies
LEARN ABOUT OPENSOLARIS
cldap_search_s
cldap_search_s(3LDAP) LDAP Library Functions cldap_search_s(3LDAP)
NAME
cldap_search_s - connectionless LDAP search
SYNOPSIS
cc[ flag... ] file... -lldap[ library... ]
#include <lber.h>
#include <ldap.h>
int cldap_search_s(LDAP *ld, char *base, int scope, char *filter,
char *attrs, int attrsonly, LDAPMessage **res, char *logdn);
DESCRIPTION
The cldap_search_s() function performs an LDAP search using the Connectionless LDAP (CLDAP) protocol.
cldap_search_s() has parameters and behavior identical to that of ldap_search_s(3LDAP), except for the addition of the logdn parameter.
logdn should contain a distinguished name to be used only for logging purposed by the LDAP server. It should be in the text format
described by RFC 1779, A String Representation of Distinguished Names.
Retransmission Algorithm
cldap_search_s() operates using the CLDAP protocol over udp(7P). Since UDP is a non-reliable protocol, a retry mechanism is used to
increase reliability. The cldap_setretryinfo(3LDAP) function can be used to set two retry parameters: tries, a count of the number of
times to send a search request and timeout, an initial timeout that determines how long to wait for a response before re-trying. timeout is
specified seconds. These values are stored in the ld_cldaptries and ld_cldaptimeout members of the ld LDAP structure, and the default val-
ues set in ldap_open(3LDAP) are 4 and 3 respectively. The retransmission algorithm used is:
Step 1 Set the current timeout to ld_cldaptimeout seconds, and the current LDAP server address to the first LDAP server found during the
ldap_open(3LDAP) call.
Step 2 Send the search request to the current LDAP server address.
Step 3 Set the wait timeout to the current timeout divided by the number of server addresses found during ldap_open(3LDAP) or to one
second, whichever is larger. Wait at most that long for a response; if a response is received, STOP. Note that the wait timeout
is always rounded down to the next lowest second.
Step 4 Repeat steps 2 and 3 for each LDAP server address.
Step 5 Set the current timeout to twice its previous value and repeat Steps 2 through 5 a maximum of tries times.
EXAMPLES
Assume that the default values for tries and timeout of 4 tries and 3 seconds are used. Further, assume that a space-separated list of two
hosts, each with one address, was passed to cldap_open(3LDAP). The pattern of requests sent will be (stopping as soon as a response is
received):
Time Search Request Sent To:
+0 Host A try 1
+1 (0+3/2) Host B try 1
+2 (1+3/2) Host A try 2
+5 (2+6/2) Host B try 2
+8 (5+6/2) Host A try 3
+14 (8+12/2) Host B try 3
+20 (14+12/2) Host A try 4
+32 (20+24/2) Host B try 4
+44 (20+24/2) (give up - no response)
ERRORS
cldap_search_s() returns LDAP_SUCCESS if a search was successful and the appropriate LDAP error code otherwise. See ldap_error(3LDAP) for
more information.
ATTRIBUTES
See attributes(5) for a description of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWcsl (32-bit) |
| |SUNWcslx (64-bit) |
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
ldap(3LDAP), ldap_error(3LDAP), ldap_search_s(3LDAP), cldap_open(3LDAP), cldap_setretryinfo(3LDAP), cldap_close(3LDAP), attributes(5),
udp(7P)
SunOS 5.11 27 Jan 2002 cldap_search_s(3LDAP)