I'm trying out doing all dev now in 8 dp* since I have no immediate production projects that require deployment. So far so good, though I miss BV2 documentation... (which seems to hang the app if I leave it in my plug-ins folder) and LCBrowser (also seems to be troublesome.)

I'm trying to pass text to a variable with the quotes escaped so that they will be retained in a shell call to mail using echo, actually this is inside a linux 7.0.1 LC server cgi script:

put dayInfo() into tVisitorsInfo

    if tVisitorsInfo is empty then exit to top

      put getAddresses() into tAddresses
      put tVisitorsInfo into tBody
      replace quote with ( "\" & quote)  ) in tBody
      # above does not work, quotes are stripped out
      # also does not break anything
      put ("echo " & quote & tBody & quote & " | ") into tCmd
put format ("mail -s \"Visitor Care Notice\" -r \"no-re...@hindu.org\" " & tAddresses) after tCmd
      get shell(tCmd)

it doesn't work... the quotes are just removed in the output (email body)

Thinking this may be some linux shell text processing issue, I tried this on my desk top:

1) make new stack
2) create two fields: i. "input ii. "output"
3) enter text with quotes in input field

Kevin Miller says, "Great things are coming!" and we actually see them popping up in LC 8.. Hurray!

3) button:
on mouseUp
put fld "input" into jai
replace quote with ( "\" & quote) in jai
put jai into fld "output"
end mouseUp

4) result in fld "output"

Kevin Miller says, "Great things are coming!" and we actually see them popping up in LC 8.. Hurray!

at least the quotes are not stripped... (as they are in the attempt to pass to echo)

So, I'm flummoxed... docs use, as an example:

replace return....

using the constant  "return"

so one would expect using the constant  "quote" to be targetable

I also tried format... but it also fails silently i.e. no replacement and no error

on mouseUp
put fld "input" into jai
put format ("\\ & \"") into tEscapedQuote
replace quote with tEscapedQuote in jai
put jai into fld "output"
end mouseUp

BR

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to