Copy same file with different variables


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copy same file with different variables
# 8  
Old 12-19-2012
Quote:
Originally Posted by pamu
That's why i have written above in my command sth like this..Smilie
Clever one! Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Change the file name and copy old file content to new file names.

Hi, I have a files in a directory as below :- ls -1 mqdepth-S1STC02 proc-mq-S1STC01 proc-mq-S1STC02 proc-mq-S1STC03 Whereever i have S1STC i need to copy them into new file with file name S2STC. expected output :- ls -1 mqdepth-S2STC02 proc-mq-S2STC01 proc-mq-S2STC02... (3 Replies)
Discussion started by: satishmallidi
3 Replies

2. Shell Programming and Scripting

Copy file and evaluate its internal variables

Hi I have been trying to figure a way to copy a file, (a template), that has internal variables. Using the values as defined for those variables in another script. So a file called x - #! /bin/bash D=aa.$X.bb And file y #! /bin/bash X=6 while read line do eval echo... (5 Replies)
Discussion started by: steadyonabix
5 Replies

3. Shell Programming and Scripting

how to copy the directory but not copy certain file

Hi experts cp bin root src /mnt but not copy bin/bigfile any help? ( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum) Thanks (6 Replies)
Discussion started by: yanglei_fage
6 Replies

4. Programming

how to copy downloaded file into my source file folder (putty/unix)

I need to "Ensure that when you download libchat.a from the VLE you have copied it to the same folder on ius as your source files. You then refer to the library (and the libraries it needs) with: gcc -o outputfile sourcefile.c -L. -lchat -lsocket -lnsl" But I have no idea what this means! (I... (2 Replies)
Discussion started by: fakuse
2 Replies

5. Red Hat

Copy certain file types recursively while maintaining file structure on destination?

Hi guys, I have just been bothered by a fairly small issue for some time now. I am trying to search (using find -name) for some .jpg files recursively. This is a Redhat environment with bash. I get this job done though I need to copy ALL of them and put them in a separate folder BUT I also... (1 Reply)
Discussion started by: rockf1bull
1 Replies

6. UNIX for Dummies Questions & Answers

How to use sed to copy specific lines from a file using shell variables?

hello! I am trying to use sed to copy specific set of lines from a file for which the starting and ending line numbers of the lines to be copied are stored in shell variables. How can i copy those lines? if the input_file is something like this and if the following is the script a=2 b=4... (4 Replies)
Discussion started by: a_ba
4 Replies

7. UNIX for Dummies Questions & Answers

copy file using a variables

i am having a file name hello.txt i want to move it to some where in the destination folder suppose name is accnt i have done this things but not working , can't we assign a path to a variable #/bin/sh file =hello.txt dest ='accnt' cp $file $dest Thank & Regard Dina (3 Replies)
Discussion started by: Manabhanjan
3 Replies

8. UNIX for Dummies Questions & Answers

Copy a windows CVS file to the unix server as a svs file

I so desperately need a script to copy a windows csv file to my unix server and i know these should be at dummies but i have no bits. it is life & no job situation help please. thanks (1 Reply)
Discussion started by: zhegal
1 Replies

9. Shell Programming and Scripting

Bash copy file contents into an existing file at a specific location

Hi all I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far: File A line 1 line 2 line 3 line 4 ... (6 Replies)
Discussion started by: gshepherd7
6 Replies
Login or Register to Ask a Question
PDOSTATEMENT.EXECUTE(3) 						 1						   PDOSTATEMENT.EXECUTE(3)

PDOStatement::execute - Executes a prepared statement

SYNOPSIS
public bool PDOStatement::execute ([array $input_parameters]) DESCRIPTION
Execute the prepared statement. If the prepared statement included parameter markers, you must either: ocall PDOStatement.bindParam(3) to bind PHP variables to the parameter markers: bound variables pass their value as input and receive the output value, if any, of their associated parameter markers oor pass an array of input-only parameter values PARAMETERS
o $input_parameters - An array of values with as many elements as there are bound parameters in the SQL statement being executed. All values are treated as PDO::PARAM_STR. You cannot bind multiple values to a single parameter; for example, you cannot bind two values to a single named parameter in an IN() clause. You cannot bind more values than specified; if more keys exist in $input_parameters than in the SQL specified in the PDO::prepare, then the statement will fail and an error is emitted. RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.2.0 | | | | | | | The keys from $input_parameters must match the | | | ones declared in the SQL. Before PHP 5.2.0 this | | | was silently ignored. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 Execute a prepared statement with bound variables <?php /* Execute a prepared statement by binding PHP variables */ $calories = 150; $colour = 'red'; $sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < :calories AND colour = :colour'); $sth->bindParam(':calories', $calories, PDO::PARAM_INT); $sth->bindParam(':colour', $colour, PDO::PARAM_STR, 12); $sth->execute(); ?> Example #2 Execute a prepared statement with an array of insert values (named parameters) <?php /* Execute a prepared statement by passing an array of insert values */ $calories = 150; $colour = 'red'; $sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < :calories AND colour = :colour'); $sth->execute(array(':calories' => $calories, ':colour' => $colour)); ?> Example #3 Execute a prepared statement with an array of insert values (placeholders) <?php /* Execute a prepared statement by passing an array of insert values */ $calories = 150; $colour = 'red'; $sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < ? AND colour = ?'); $sth->execute(array($calories, $colour)); ?> Example #4 Execute a prepared statement with question mark placeholders <?php /* Execute a prepared statement by binding PHP variables */ $calories = 150; $colour = 'red'; $sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < ? AND colour = ?'); $sth->bindParam(1, $calories, PDO::PARAM_INT); $sth->bindParam(2, $colour, PDO::PARAM_STR, 12); $sth->execute(); ?> Example #5 Execute a prepared statement using array for IN clause <?php /* Execute a prepared statement using an array of values for an IN clause */ $params = array(1, 21, 63, 171); /* Create a string for the parameter placeholders filled to the number of params */ $place_holders = implode(',', array_fill(0, count($params), '?')); /* This prepares the statement with enough unnamed placeholders for every value in our $params array. The values of the $params array are then bound to the placeholders in the prepared statement when the statement is executed. This is not the same thing as using PDOStatement::bindParam() since this requires a reference to the variable. PDOStatement::execute() only binds by value instead. */ $sth = $dbh->prepare("SELECT id, name FROM contacts WHERE id IN ($place_holders)"); $sth->execute($params); ?> NOTES
Note Some drivers require to close cursor before executing next statement. SEE ALSO
PDO.prepare(3), PDOStatement.bindParam(3), PDOStatement.fetch(3), PDOStatement.fetchAll(3), PDOStatement.fetchColumn(3). PHP Documentation Group PDOSTATEMENT.EXECUTE(3)