LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-14-2009, 01:51 PM   #1
adamlucansky
LQ Newbie
 
Registered: Sep 2009
Distribution: Distro Mr. Gates
Posts: 19

Rep: Reputation: 0
Auto-escaping text


Hello guys, this time, another problem.

Text
Code:
'LDAP_Object_Classes' => array("top", "inetOrgPerson"),
... If I enter this text into variable, its fine, but when variable is used, for example entering into /usr/bin/mysql ... -c "INSERT ... $text", it makes troubles, is there any kind of echo which automatically escape all characters ?

Something like mysql_real_escape_string in php

Last edited by adamlucansky; 11-16-2009 at 06:53 AM.
 
Old 11-15-2009, 08:19 AM   #2
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
LDAP

A more appropriate choice of topic title would have been helpful. Anyway, unfortunately there is no LDAP escape function in PHP, you'll have to write your own.
 
Old 11-16-2009, 06:45 AM   #3
adamlucansky
LQ Newbie
 
Registered: Sep 2009
Distribution: Distro Mr. Gates
Posts: 19

Original Poster
Rep: Reputation: 0
No No , that was just example text, i mean, something like mysql_real_escape_string which escape all quote characters.

Example:
Code:
/usr/bin/somecommand 'LDAP_Object_Classes' => array("top", "inetOrgPerson"),
\'LDAP_Object_Classes\' => array(\"top\", \"inetOrgPerson\"),

Last edited by adamlucansky; 11-16-2009 at 06:53 AM.
 
Old 11-16-2009, 03:00 PM   #4
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
escapeshellarg

Is it possible, you're looking fog escapeshellarg()?
 
Old 11-17-2009, 05:14 AM   #5
adamlucansky
LQ Newbie
 
Registered: Sep 2009
Distribution: Distro Mr. Gates
Posts: 19

Original Poster
Rep: Reputation: 0
I mean, like command echo in bash, not PHP, that was like example. Same like /bin/echo , but it return same text but escaped
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto-login to text-mode? kola Fedora 4 06-14-2010 05:46 AM
Pidgin auto complete typing text sadarax Linux - Software 2 08-11-2008 09:57 AM
DQ: how do you turn off auto-copy when you highlight text in KDE? jetblackz Linux - Newbie 7 05-10-2008 06:23 PM
Auto login in the text mode JHR Linux - Software 3 04-23-2005 08:47 PM
Looking for auto text tool bitpicker Linux - Software 0 01-13-2004 02:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration