I am unable to read fields from awk
command in Tcl while it runs in a terminal but not in Tcl script.
Tried making syntax changes, it works in terminal not in script
set a { A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }
#store only cell var in file
exec grep -in "cell (?*" ./slow.lib | cut -d "(" -f2 | cut -d ")" -f1 > cells.txt
#take alphabets to loop
foreach b $a {
puts "$b\n"
if { [ exec cat cells.txt | awk ' $1 ~ /^$b/ ' ] } {
foreach cell [exec cat ./cells.txt] {
puts "$b \t $cell"
}
}
The condition should check for first char in the file and give boolean. The error is:
can't read "1": no such variable while executing "exec cat cells.txt | awk ' $1 ~ /^$b/ ' "