I am trying to print a particular text using awk if string is empty. It works fine in the below case
noob@noob:~$ echo "" | awk '{if ($0=="") print "not playing"}'
not playing
but when I try to take a similar approach in the below case it didn't work
noob@noob:~$ mpc current | awk '{if ($0=="") print "not playing"}'
noob@noob:~$
I believe the output of mpc current if no song is playing is an empty string.
noob@noob:~$ mpc current
noob@noob:~$ #empty string
So, is my assumption of empty string wrong?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)