diff --git a/src/debashify.cpp b/src/debashify.cpp index c1c8632..29a7bb8 100644 --- a/src/debashify.cpp +++ b/src/debashify.cpp @@ -782,6 +782,14 @@ bool debashify_procsub(list_t* lst, debashify_params* params) } } } + for(auto reit: cmit->redirs) { + arg_t* ait=reit->target; + if(ait != nullptr && ait->size() == 1 && ait->sa[0]->type == _obj::subarg_procsub) + { + subarg_procsub_t* st = dynamic_cast(ait->sa[0]); + affected_args.push_back( std::make_pair(ait, st->is_output) ); + } + } } } // perform the replace diff --git a/test/debashify.bash b/test/debashify.bash index 0088c88..06d5e09 100644 --- a/test/debashify.bash +++ b/test/debashify.bash @@ -44,3 +44,7 @@ echo ${TITI:-bar} TATA=TOTO echo ${!TATA} + +for I in A B C ; do + echo "$I" +done > >(grep A)