Write a shell program to test whether a given number is even
or odd?
Answer Posted / santana20142003
$ echo <number> | nawk '{ if($0 % 2 ==0) print $0 "Even
Number" ;\
else print $0 "Odd Number"}'
| Is This Answer Correct ? | 24 Yes | 17 No |
Post New Answer View All Answers
What is eval in shell script?
How do I run a shell script in powershell?
Why should we use shell scripts?
What does echo $0 do?
Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?
What can you do with powershell?
What is sudo command?
What is the best shell scripting language?
Print the 10th line without using tail and head command.
How do I run a bin bash script?
What is a boot block?
Is bash a shell script?
What does the sh command do?
Why is it called a shell?
Explain about echo command?