If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > sed question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-04, 01:51
msuluhan msuluhan is offline
Registered User
 
Join Date: Jan 2004
Posts: 18
sed question

How can I change $PHP_SELF into $_POST["PHP_SELF"]
__________________
Murat SULUHAN
Live Free or Die
Reply With Quote
  #2 (permalink)  
Old 02-11-04, 06:54
Damian Ibbotson Damian Ibbotson is offline
Padawan
 
Join Date: Jun 2002
Location: UK
Posts: 525
Re: sed question

Quote:
Originally posted by msuluhan
How can I change $PHP_SELF into $_POST["PHP_SELF"]
This should what you are asking...

echo '$PHP_SELF' | sed 's/\$\(.*\)/$_POST["\1"]/'

I suspect your requirement is a little more complicated than that though (?).

Damian
Reply With Quote
  #3 (permalink)  
Old 02-11-04, 08:35
msuluhan msuluhan is offline
Registered User
 
Join Date: Jan 2004
Posts: 18
thank you so much
__________________
Murat SULUHAN
Live Free or Die
Reply With Quote
  #4 (permalink)  
Old 02-11-04, 08:44
Damian Ibbotson Damian Ibbotson is offline
Padawan
 
Join Date: Jun 2002
Location: UK
Posts: 525
Obviously you realise that the following would give the same result but I'm assuming there is more to the problem that you have said, so I posted the more flexible solution.
Code:
echo '$PHP_SELF' | sed 's/\$PHP_SELF/$_POST["PHP_SELF"]/'
Reply With Quote
  #5 (permalink)  
Old 02-11-04, 10:11
msuluhan msuluhan is offline
Registered User
 
Join Date: Jan 2004
Posts: 18
I wanted to develop a script, and your text would be very useful for me, thanks again
__________________
Murat SULUHAN
Live Free or Die
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On