Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to make the variables of one script available for the other scripts? Post 302457882 by sumitpandya on Wednesday 29th of September 2010 02:41:22 AM
Old 09-29-2010
You write desired "export VAR=VAL" into a temp file and execute "./temp" before "/root/Shell_Scripts/second.sh". In other way you can write "VAR=VAL" into temp file and execute ". temp" before "/root/Shell_Scripts/second.sh"
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Regarding Make Scripts

Hi I'm well worsed in Shell Scripting on UNIX OS. But I found the script used in Make file for compiling the unix sources is quite criptic. Even though it looks some what like any other Shell Script, but I noticed lots of difference & I'm always facing difficult in understanding the code... (5 Replies)
Discussion started by: S.Vishwanath
5 Replies

2. Shell Programming and Scripting

is there any way to make flat file from some of scripts ?

Hello is there any way to if lets say i have main.pl script , but i have 3 includes in this perl script now i will like to some how to treat this main.pl and its includes files as single file something like -E (Preprocess only; do not compile, assemble or link) in the c compilers . in short i... (0 Replies)
Discussion started by: umen
0 Replies

3. Shell Programming and Scripting

How to make the same change in multiple shell scripts?

I would like to make the same change in multiple shell script files and would like to know if anyone can be of some help? I would appreciate it. (4 Replies)
Discussion started by: rdakhan
4 Replies

4. UNIX for Dummies Questions & Answers

Variables in scripts

Just a quick question. If I have a script that calls another script while running, is it possible for the second script to reference a variable in the first script and if so, how. Is it scriptname.sh:$VARIABLE for a global variable and can you do scriptname.sh:function $VARIABLE or am I off my... (1 Reply)
Discussion started by: kirkm76
1 Replies

5. Shell Programming and Scripting

How to make variables in script function local?

Is it possible to make function variables local? I mean for example, I have a script variable 'name' and in function I have declared variable 'name' I need to have script's 'name' have the same value as it was before calling the function with the same declaration. The way to preserve a... (5 Replies)
Discussion started by: alex_5161
5 Replies

6. UNIX for Advanced & Expert Users

Script to make a table from Named Variables.

I need a shell script to make a table from Named Variables Input File(Can have multiple lines): a=1,b=2,d=4,e=5 a=11,b=12,c=13,d=14 Output file: a,b,c,d,e 1,2,,4,5 11,12,13,14, Thanks in advance (7 Replies)
Discussion started by: shariramani
7 Replies

7. UNIX for Dummies Questions & Answers

Tips to make scripts install

Hi, I have a series of BASH shell scripts that I would like to package and distribute. I would like to make it as easy as possible users to install the package on their system. The only tasks that need to be performed for installation are 1) unzip the package, 2) modify the user's ~/.bashrc... (1 Reply)
Discussion started by: msb65
1 Replies

8. Shell Programming and Scripting

Using a script to define variables and run multiple other scripts in succession.

I'm pretty new to scripting in Korn shell so please forgive me... What I'm trying to do is to create a script that calls multiple other ksh scripts and defines variables for text files. I need it to define my user defined variables (file paths, date & time stamps, etc that are currently in... (1 Reply)
Discussion started by: bluejwxn8
1 Replies

9. UNIX for Dummies Questions & Answers

Trying to make a script to run 3 other scripts in a screen.

Hello, my name is Spurkle. I'm new to linux stuff. Currently I am trying to make a script which will run three other scripts in screen. This is the code: sudo screen -S hubServ /var/servers/hub/hub.sh sudo screen -S facServh /var/servers/factions/factions.sh sudo screen -S bunServ... (5 Replies)
Discussion started by: Spurkle
5 Replies

10. UNIX for Beginners Questions & Answers

Need to get out of 2 variables in scripts

Hi All, i have written below script, and out put i am looking for both variable PRIMARY_CONF and $STANDBY_CONF but i am getting below error d1.sh: line 64: ------------------------------ line 64 is: if -a ; then ---------------------------------- please let me know where is the... (9 Replies)
Discussion started by: amar1208
9 Replies
MAXDB_STMT_AFFECTED_ROWS(3)						 1					       MAXDB_STMT_AFFECTED_ROWS(3)

maxdb_stmt_affected_rows - Returns the total number of rows changed, deleted, or inserted by the last executed statement

       Procedural style

SYNOPSIS
int maxdb_stmt_affected_rows (resource $stmt) DESCRIPTION
Object oriented style int$maxdb_stmt->affected_rows () maxdb_stmt_affected_rows(3) returns the number of rows affected by INSERT, UPDATE, or DELETE query. If the last query was invalid or the number of rows can not determined, this function will return -1. RETURN VALUES
An integer greater than zero indicates the number of rows affected or retrieved. Zero indicates that no records where updated for an UPDATE/DELETE statement, no rows matched the WHERE clause in the query or that no query has yet been executed. -1 indicates that the query has returned an error or the number of rows can not determined. EXAMPLES
Example #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } /* create temp table */ $maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); $query = "INSERT INTO temp.mycity SELECT * FROM hotel.city WHERE state LIKE ?"; /* prepare statement */ if ($stmt = $maxdb->prepare($query)) { /* Bind variable for placeholder */ $code = 'N%'; $stmt->bind_param("s", $code); /* execute statement */ $stmt->execute(); printf("rows inserted: %d ", $stmt->affected_rows); /* close statement */ $stmt->close(); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } /* create temp table */ maxdb_query($link, "CREATE TABLE temp.mycity LIKE hotel.city"); $query = "INSERT INTO temp.mycity SELECT * FROM hotel.city WHERE state LIKE ?"; /* prepare statement */ if ($stmt = maxdb_prepare($link, $query)) { /* Bind variable for placeholder */ $code = 'N%'; maxdb_stmt_bind_param($stmt, "s", $code); /* execute statement */ maxdb_stmt_execute($stmt); printf("rows inserted: %d ", maxdb_stmt_affected_rows($stmt)); /* close statement */ maxdb_stmt_close($stmt); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: rows inserted: 4 SEE ALSO
maxdb_stmt_num_rows(3), maxdb_prepare(3). PHP Documentation Group MAXDB_STMT_AFFECTED_ROWS(3)
All times are GMT -4. The time now is 05:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy