Adapted $() execution to get identical results to file input