Eval in for with two arguments -


i wrote 2 function in script

for type in $list_type     egrep -v 'dc02|vh|dc03kh00|r0' $report_37 | grep cp_ask | grep $dc |awk -f, -v type=$type '$nf == type { print $1 }' > ./$dc_'type_'$type     empty_type_$type=$(cat $dc'_type_'$type | wc -l) done 

the second use in other empty_type_$type did

for type in $list_type     eval echo \$empty_type_$type     egrep -v 'dc02|vh|dc03kh00|r[0-2]' $report_33 | grep not | grep $dc |awk -f, -v days=$days -v version=$version -v type=$type '{if (($(nf-15)  > days || $(nf-02)!= version) && ($(nf-20) == type))  print $1}' | eval tail -n \ empty_type_$type > ./$dc'_to_work' done 

the problem error

awk -f, -v days=180 -v version=6.7 -v type=e '{if (($(nf-15)  > days || $(nf-02)!= version) && ($(nf-20) == type))  print $1}' + eval tail -n '$empty_type_e' 

when run command (not in bash script)

egrep -v 'dc02|vh|dc03kh00|r[0-2]' report_33.20170720.075339 | grep not | grep $dc |awk -f, -v days=$days -v version=$version  '{if (($(nf-15)  > days || $(nf-02)!= version) && ($(nf-20) == "a"))  print $1}' | eval tail -n \$empty_type_$type 

it works.

in first function empty_type_$type=$(cat $dc'type'$type | wc -l) should eval empty_type_$type=$(cat $dc'type'$type | wc -l)

that issue


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -