1

I wish to call another shell script tm.sh within AWK. I'm trying as below but its not working as no error during executing this command but output doesn't display that I coded into tm.sh. please help me.

bdf | awk '{if($5>90 && $6=="/u05") {(exec "/u05/bkpscript/tm.sh") }}'
2

Use system() function:

awk '{printf("%s ",$1); system("d2h " $2)}' file
  • i am not able to call another script from system() command. – Jhon samuel Aug 2 '17 at 9:07
  • @Jhonsamuel in that case, there's either something wrong with your input data (no lines match the 2 conditions you set) or something wrong with your script. We can't help you if you don't show your data and the script. – terdon Aug 2 '17 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.