> This should do what you need: > > npp=38 > res=$(echo `wc -l`) > pretty () { rev <<<$1|perl -pe 's/(\d{3})(?=.)/$1,/g'|rev; } > total=$(pretty $(cut <<<$res -d\ -f1)) > php -r "echo ceil($TM_LINE_NUMBER/$npp).'/'.ceil($total/$npp);" I get the following error: > Warning: Wrong parameter count for ceil() in Command line code on line 1 58/