Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Avoid expansion and escaping

Apr
35
0
I have a .ini file with a value like this:
this %is% || a `parameter` %+ another %= && another 'abc';

I'm reading the line @iniread. How can I set this verbatim to an environment variable, then echo that environment variable value, then pass it as a parameter to another program? (without ever interpreting the line)
 
I have a .ini file with a value like this:
this %is% || a `parameter` %+ another %= && another 'abc';

I'm reading the line @iniread. How can I set this verbatim to an environment variable, then echo that environment variable value, then pass it as a parameter to another program? (without ever interpreting the line)

@INIREAD doesn't care about special characters. But you'll want to turn off nested variable expansion (SETDOS /X-4) so TCC doesn't try to expand the variables in the returned value.

If you want to echo it (why?) you can use ECHOX, which doesn't do any variable expansion, redirection, multiple commands, or compound commands.

If you want to pass it to another program you'll have to use SETDOS /X-35 to turn off variable expansion and multiple commands / conditional commands / piping. (Maybe add 7 to ignore quoting too.)
 
Almost there... How can I pass this strange line in a variable (a) to another command without the %is% expanding?

2013-04-17_1234.png


And yes, the @iniread works fine, was just an example of getting a line with special characters, I'm also using @fileread, @line, and @xmlxpath. The echo is to be able to see the line on the console as part of the script. Attached are the files shown.
 

Attachments

  • strange.zip
    693 bytes · Views: 228

Similar threads

Back
Top