How to transfer values of parametrs from civ to sh_terminal?

Guest
I want to write a script for fitting is the circuit parameters, which must meet some requirements. For example, the average delay should be minimal.
I decided to start simple. The inverter is taken to write the script. Analyzes the optimal ratio of the widths of transistors. Minima-flax delay revealed from the output text file using fprintf (f "The best timing% 4.1f. P" Td2 * 1e12 "\ n"). I want to get the X11 and X22 (the width of the transistors), corresponding to the minimum delay from file f. f = outfile ("/ home / Ivanov / Desktop / out.txt")

In the terminal
Td2 = 5.2 (min Tg)
cat | grep $ Td2 / home / Ivanov / Desktop / out.txt >> / home / Ivanov / Desktop / out.txt
Everything works, ie string is appended to the file in which the minimum delay.
In icfb
sh ("grep 2.59 / home / Ivanov / Desktop / out.txt") to the terminal displays the last line.
sh ("Td = 3; echo $ Td") Displays the terminal value of Td.
sh ("Td2 = 2.59; grep $ Td2 / home / Ivanov / Desktop / out.txt") to the terminal displays the last line.

sh ("cat | grep 2.59 / home / Ivanov / Desktop / out.txt >> / home / Ivanov / Desktop / out.txt") hangs.
sh ("grep $ Td2 / home / Ivanov / Desktop / out.txt") believed that Td2 will be taken from the final values obtained in the script, and even tried to set Td2 through sh. Hangs in both cases.
As I understand it, Td2, which is calculated in the script, is not perceived in the sh ("cat | grep $ Td2 / home / Ivanov / Desktop / out.txt >> / home / Ivanov / Desktop / out.txt")

Questions:
How to set a parameter in the terminal (Td2), at the same value as in the script (Td2), to use the command grep, which will search for the desired result to me in a text document, a line containing the value is the same as Td2?
How to use cat or what to use to append line to a text file?

thanks
Vadim
 

Welcome to EDABoard.com

Sponsor

Back
Top