07-06-2009
Is there any difference between the echo syntax in your longer and the working shorter script? Basically you have problems with single and/or double quotation marks it seems. Maybe try playing around by escaping them with a backslash until you get the desired output.
Another way might be putting the statement to a plain file and then hand it over as a parameter to your script to have less hassle.
Also use CODE-tags when posting code, data or logs in future please.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear Sir,
I am working in a bank and our parent bank has developed an application package which will work with oracle 8i on unix platform. The unix on the server is unix ware 7.1.1 with pro*c compiler. My question is
1. Whether Oracle 8i or above for windows will work on any unix version... (1 Reply)
Discussion started by: Parameswaran.AR
1 Replies
2. Shell Programming and Scripting
Hi All,
I need to select one column from a table based upon the passed in parameter.
I tried this:
sqlplus -silent $MISP_USER << EOF
set feedback off;
set verify off;
set sqlprompt ""
SELECT mail_flag
FROM dailyjobs
WHERE job_name = '$1';
exit 0
EOF
exit... (1 Reply)
Discussion started by: ganga.dharan
1 Replies
3. Shell Programming and Scripting
Hi,
I have a piece of shell script which will connect to mysql database and execute a load statement(which will load datas in a file to the database table).The code is working and the data is in the tables.
Now my requirement is, i need to grab the output from the load statement... (4 Replies)
Discussion started by: DILEEP410
4 Replies
4. Programming
The problem I was working on is solved, but felt it would be worthwhile to ask for some opinions as to whether the approach can actually be improved.
I am using the following example and data taken from https://www.unix.com/high-level-programming/119134-sql-datetime-calculations.html and MySQL... (0 Replies)
Discussion started by: figaro
0 Replies
5. Shell Programming and Scripting
Hi,
How to execute sql statements from the .sh file ??
Means, when we run .sh file then the sql statements within it should be get executed one by one from the sqlplus
With Regards (3 Replies)
Discussion started by: milink
3 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Create a phonebook program.
It should use functions to perform the required tasks. It should be menu-based,... (1 Reply)
Discussion started by: Rgasin02
1 Replies
7. Red Hat
Hi
i want to update the BASH because of the "shell shock" vulnerability.
my RedHat 5 is clean install with the default mirror site.
when im running the command: yum update bash
im getting a message saying there is no update. you can see in the attach picture...
what am i doing wrong? is... (4 Replies)
Discussion started by: guy3145
4 Replies
8. Shell Programming and Scripting
Hi,
i want to do the following:
Grep the following kind of strings for the 15digit ID which is stored in filename1:
"14:06:51.396 INFO BMCREMEDYSD INPUT-ACTION Failed to retrieve Remedy Incident Modification record: 000000000039047 org.apache.axis2.AxisFault: Read timed out - complete... (9 Replies)
Discussion started by: Khushbu
9 Replies
9. Shell Programming and Scripting
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
10. Shell Programming and Scripting
i have a "if .. then exit end " in s shell script on remote servers.
now the connection to the remote server got killed after i run this script on the remote servers. How do i run this script on remote hosts and still keep remote connections alive after executing the script.
Thank you. (10 Replies)
Discussion started by: moonmonk
10 Replies
LEARN ABOUT PHP
addslashes
ADDSLASHES(3) 1 ADDSLASHES(3)
addslashes - Quote string with slashes
SYNOPSIS
string addslashes (string $str)
DESCRIPTION
Returns a string with backslashes before characters that need to be escaped. These characters are single quote ( '), double quote ( "),
backslash ( ) and NUL (the NULL byte).
An example use of addslashes(3) is when you're entering data into string that is evaluated by PHP. For example, O'Reilly is stored in
$str, you need to escape $str. (e.g. eval("echo '".addslashes($str)."';"); )
To escape database parameters, DBMS specific escape function (e.g. mysqli_real_escape_string(3) for MySQL or pg_escape_literal(3),
pg_escape_string(3) for PostgreSQL) should be used for security reasons. DBMSes have differect escape specification for identifiers (e.g.
Table name, field name) than parameters. Some DBMS such as PostgreSQL provides identifier escape function, pg_escape_identifier(3), but not
all DBMS provides identifier escape API. If this is the case, refer to your database system manual for proper escaping method.
If your DBMS doesn't have an escape function and the DBMS uses to escape special chars, you might be able to use this function only when
this escape method is adequate for your database. Please note that use of addslashes(3) for database parameter escaping can be cause of
security issues on most databases.
The PHP directive magic_quotes_gpc was on by default before PHP 5.4, and it essentially ran addslashes(3) on all GET, POST, and COOKIE
data. Do not use addslashes(3) on strings that have already been escaped with magic_quotes_gpc as you'll then do double escaping. The func-
tion get_magic_quotes_gpc(3) may come in handy for checking this.
PARAMETERS
o $str
- The string to be escaped.
RETURN VALUES
Returns the escaped string.
EXAMPLES
Example #1
An addslashes(3) example
<?php
$str = "Is your name O'Reilly?";
// Outputs: Is your name O'Reilly?
echo addslashes($str);
?>
SEE ALSO
stripcslashes(3), stripslashes(3), addcslashes(3), htmlspecialchars(3), quotemeta(3), get_magic_quotes_gpc(3).
PHP Documentation Group ADDSLASHES(3)