Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exec echo - argument list too long

Status
Not open for further replies.

borkoff

Programmer
Apr 12, 2012
2
LV
I am getting an error:

couldn't execute "echo": argument list too long
while executing
"exec echo RES_local="$RES" >> $out_file"
(file "./test.tcl" line 1177)

So with exec in this case I am invoking a subprocess - bash echo command and writing to $out_file.
I understand that this is because $RES is too big and ARG_MAX on my system is too small for echo command to execute.

Can anyone suggest how to overcome this problem please?

P.s. I do not want to trim the variable
 
Anyway - solution:

[set variables before]

set outfile [open "$file" a]

puts $outfile RES_loc="$RES"
puts $file

close $outfile
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top