Linux Bash Arithmetic Expressions

  Home  Operating System Linux  Linux Bash Arithmetic Expressions


“Bash Arithmetic Expressions frequently Asked Questions in various Linux Bash Arithmetic Expressions job Interviews by interviewer. The set of questions here ensures that you offer a perfect answer posed to you. So get preparation for your new job hunting”



50 Linux Bash Arithmetic Expressions Questions And Answers

22⟩ After running this program, if you enter 1000, then what will be the output of the program? #!/bin/bash echo "Please enter a number" read a if [ $a -lt 100 ]; then echo "It is less than 100"; elif [ $a -lt 1000 ]; then echo "It is less than 1000" else echo "It is greater than 1000" fi exit 0 a) It is greater than 1000 b) It is less then 1000 c) It is equal to 1000 d) none of then mentioned

a) It is greater than 1000

 152 views

23⟩ What is the output of this program? #!/bin/bash echo "Which file do you want to check" read x until [ -e $x ] do echo "The file does not exist. Do you want to create? y/n" read a if [ $a = y ]; then touch $x echo "Your file has been created successfully." fi done echo "The file is present in this directory" exit 0 a) it checks the existance of your entered file in the present working directory b) it creates the file if file does not exists c) program runs untill you create the file d) all of the mentioned

d) all of the mentioned

 155 views

26⟩ 5. After running this program, as you press 's', what will be the output of the program? #!/bin/bash echo "press 's' to print interviewquestionsanswers" read var if $var=s then echo "interviewquestionsanswers" else echo "You did not press s" fi exit 0 a) interviewquestionsanswers b) You did not press s c) program will generate an error message d) none of the mentioned

c) program will generate an error message

 173 views

27⟩ After running this program, as your press 4, what will be the output of the program? #!/bin/bash echo "How many times you want to print 'globalguideline'" read value for ((i=0;i<$value;i++)) do echo "globalguideline"; done exit 0 a) 'globalguideline' will print 4 times b) 'globalguideline' will print 3 times c) 'globalguideline' will print 5 times d) program will generate an error message

a) 'globalguideline' will print 4 times

 175 views

33⟩ Which one of the following is not correct about job control in bash shell? a) it is the ability to stop and resume any process running in shell at a later point b) user employs this facility via an interactive interface supplied by the kernel's terminal driver and bash c) it is the ability to create any process d) none of the mentioned

a) it is the ability to stop and resume any process running in shell at a later point

 148 views