Jump to content

Backticks Inside Backticks


kubabuk

Recommended Posts

Guys, I'm trying to dynamically create the following command

opparm /out/test -v -p eframe ( `ch("../../img/all/all/f1")` )

to do that I using stringcat expression

opparm /out/test -v -p eframe ( `strcat(strcat("ch\(\"../..",chs("rop")),"\/f1\"\)")` )

But I get an error because it is not possible to have double back ticks. The problem is that I need one set of them otherwise my expression will not be evaluated. So the following doesn't work:

`strcat(strcat("\`ch\(\"../..",chs("rop")),"\/f1\"\)\`")`

simpler test doesn't work as well

echo `strcat("\`","test\`")`

Do you have any idea?

PS. probably answer is again pretty simple :)

thanks

kuba

Link to comment
Share on other sites

Hi there,

The easiest solution is to break your break your command into two (and use varaibles).

So, first stash the evaluation of your deepest expression in a variable, and then use the variable in the our expression. Know what I mean?

set tmpvar = `firstexpression()`

`secondexpression( $tmpvar )`

- and thus avoid nested expressions:)

Link to comment
Share on other sites

( `strcat(strcat("ch\(\"../..",chs("rop")),"\/f1\"\)")` )

:thumbsup:

we should setup some game on it! Who will write more aesthetically pleasing piece of WORKING code

quite nice attempt Kuba!

:oneeyedsmiley02:

Edited by SYmek
Link to comment
Share on other sites

( `strcat(strcat("ch\(\"../..",chs("rop")),"\/f1\"\)")` )

:thumbsup:

we should setup some game on it! Who will write more aesthetically pleasing piece of WORKING code

quite nice attempt Kuba!

:oneeyedsmiley02:

That's a "side effect" of my recent work :rolleyes: - definitely too much awk stuff recently

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...