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 do you know which shell I am using?
Is scripting and coding the same thing?
How to replace following lines, catch (DAOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } catch (BOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw e; } catch (Exception e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } Needs to be changed in to, catch (DAOException e) { AppException.handleException (null, null, e, null, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); } catch (BOException e) { AppException.handleException (null, null, null, e, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 0); } catch (Exception e) { AppException.handleException (null, null, null, null, null, e, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); }
What makes c shell a more preferable option than the bourne shell?
What is the equivalent of a file shortcut that we have a window on a linux system?
What is the difference between scripting and coding?
c program to display the information of given file similar to givan by the unix or linux command ls -l
How to print all the arguments provided to the script?
What is bash used for?
How do I run a .sh file on mac?
What is shell geeksforgeeks?
What language is used in terminal?
How can the contents of a file inside jar be read without extracting in a shell script?
How will you copy a file from one machine to other?
How does shell scripting work?