Question: 1. Write a shell script is_int to identify if the input string is an integer, e.g., is_int 1978 should display 1978 is an integer, and

1. Write a shell script is_int to identify if the input string is an integer, e.g., "is_int 1978" should display "1978 is an integer", and "is_int Hahah12" should display "Hahah12 is not an integer" Hint: The regular expression [0-9]+$ will match a non-empty contiguous string of digits, i.e. a non-empty line that is composed of nothing but digits. a 2. Write a shell script display_digits to display all digits ( from left right ) if the input is an integer, otherwise, show that the input is not an integer, e.g., "display_digits 1978 show "1 9 7 8", and "display Hahah12" should display "Hahah12 is not an integer" Hint: you will likely need to use the pipe 1, echo command, and cut -c command
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
