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
How to redirect both standard output and standard error to the same location?
What is in a script?
Is powershell a language?
Is shell scripting a language?
How to get script name inside a script?
Why do we write bin bash in shell scripts?
How will you pass and access arguments to a script in linux?
c program to display the information of given file similar to givan by the unix or linux command ls -l
What is the conditional statement in shell scripting?
What are the four fundamental components of every file system on linux?
What are the different types of variables used in shell script?
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 is an sh file?
What is subshell?
How does path variable work?