Variables of executed script available in executing script
Hi,
I have a script get_DB_var.ksh which do a data base call and get some variables as below:
Now I want to access all these variables i.e. col1,col2,col3... in the script that executes get_DB_var.ksh as below:
is this possible? or do I have to write values of col1,col2,col3... in a file and then read it in set_DB_var.ksh?
What I want to know is that do we have some command to see the variables of the executed script?? the similar way we have "export" command to have variables available in the called script!
Dear all
I would like to capture who executed a script to a script's variable (i.e. testing.sh), so I can save it to a log file.
testing.sh
#! bin/ksh
user=`<< code here >>` // get the info below in RED color
<<main logic>>
echo "$user execute testing.sh on `date`" >> testing.log
... (2 Replies)
I need to execute a shell script kept in unix machine from windows. User id, password area available.
For eg.
There's a shell script wich moves all the logs kept in my home directory to a directory named LOGS.
Now i need to get this done through windows; either using a batch file, or java... (4 Replies)
Hi
Script not getting executed via cron but executes successfully when executed manually. Please assist
cbspsap01(appuser) /app/scripts > cat restart.sh
#!/bin/ksh
cd /app/bin
date >>logfile.out
echo "Restart has been started....." >>logfile.out
date >>logfile.out
initfnsw -y restart... (3 Replies)
Guys,
How can we know whether a script has been executed successfully or not ?
We dont have any log directories, and we are not given a chance to modify the script. Could someone help me out with this Thanks (2 Replies)
Hi i wrote a script which dosent exists after executing any help
#!/bin/bash
netstat -ptlen | grep 10000
if ; then
echo "Hive Thrift server is running"
exit 0
else
echo "Hive Thrift server is down Trying to Bring up the service" | mail -s "ALERT" team@domain.com
`nohup hive... (7 Replies)
Hi,
I am having a shell script which has a while loop as shown below.
while
do
sleep 60
done
I am executing this script from Informatica ETL tool command task from where we can execute UNIX commands/scripts. When i do that, i am seeing 2 processes getting started for one script... (2 Replies)
Hi
As per my requirement when I run . ./file.sh am getting the following error
-bash:ELF: command not found
when i execute as ./file.sh it is getting executed.How to resolve this.
Thanks in advance. (3 Replies)
Hello All,
I copied and pasted the "/etc/init.d/skeleton" file to a new one so I could create my own init script for a program.
Basically the ONLY edit I made to the skeleton "template" so far was to search and replace "FOO" with "snort".
*NOTE: I know there are a bunch of snort init scripts... (6 Replies)
I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Hi All,
I have written a programme where i need to work in one session but when that session get executed it doesnt execute other programme till I write exit. Below is the script
#!/bin/bash
echo 'Going to start'
exectrusteduser.com sh.com
cd /UAT_Logs/CDCI_LOGS/SEEDADM
pwd
echo... (6 Replies)
Discussion started by: ripudaman.singh
6 Replies
LEARN ABOUT PHP
pg_connect
PG_CONNECT(3)PG_CONNECT(3)pg_connect - Open a PostgreSQL connectionSYNOPSIS
resource pg_connect (string $connection_string, [int $connect_type])
DESCRIPTION pg_connect(3) opens a connection to a PostgreSQL database specified by the $connection_string.
If a second call is made to pg_connect(3) with the same $connection_string as an existing connection, the existing connection will be
returned unless you pass PGSQL_CONNECT_FORCE_NEW as $connect_type.
The old syntax with multiple parameters $conn = pg_connect("host", "port", "options", "tty", "dbname") has been deprecated.
PARAMETERS
o $connection_string
- The $connection_string can be empty to use all default parameters, or it can contain one or more parameter settings separated by
whitespace. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty
value or a value containing spaces, surround it with single quotes, e.g., keyword = 'a value'. Single quotes and backslashes
within the value must be escaped with a backslash, i.e., ' and \. The currently recognized parameter keywords are: $host,
$hostaddr, $port, $dbname (defaults to value of $user), $user, $password, $connect_timeout, $options, $tty (ignored), $sslmode,
$requiressl (deprecated in favor of $sslmode), and $service. Which of these arguments exist depends on your PostgreSQL version.
The $options parameter can be used to set command line parameters to be invoked by the server.
o $connect_type
- If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection is created, even if the $connection_string is identical to an exist-
ing connection.
RETURN VALUES
PostgreSQL connection resource on success, FALSE on failure.
EXAMPLES
Example #1
Using pg_connect(3)
<?php
$dbconn = pg_connect("dbname=mary");
//connect to a database named "mary"
$dbconn2 = pg_connect("host=localhost port=5432 dbname=mary");
// connect to a database named "mary" on "localhost" at port "5432"
$dbconn3 = pg_connect("host=sheep port=5432 dbname=mary user=lamb password=foo");
//connect to a database named "mary" on the host "sheep" with a username and password
$conn_string = "host=sheep port=5432 dbname=test user=lamb password=bar";
$dbconn4 = pg_connect($conn_string);
//connect to a database named "test" on the host "sheep" with a username and password
$dbconn5 = pg_connect("host=localhost options='--client_encoding=UTF8'");
//connect to a database on "localhost" and set the command line parameter which tells the encoding is in UTF-8
?>
SEE ALSO pg_pconnect(3), pg_close(3), pg_host(3), pg_port(3), pg_tty(3), pg_options(3), pg_dbname(3).
PHP Documentation Group PG_CONNECT(3)