which of the following command sets the previously undefined variable x to 40?
typset x=32+8
set x=32+8
let x=32+8
x=32+8
Which one of the following command shows the last 50 commands the user has entered.
fc -l 50
fc -l -50
history 50
history $$
Which one of the following is the syntax for a pattern that matches the null string or a filename beginning with a or A
?([A-a].*)
?([aA]*)
?([aA].*)
?([aA]$)
Consider the following case echo * We know that the output will be the list of all the files in current directory or equivalent to ls output. Which of the following command gives the ouput as * for the above script.
set -t
set -m
set -f
set -l
Which key allows to append the script in next line
Single quote
front slash
full stop
back slash
#! /bin/ksh for i in 1 2 3 4 ......... 50 # loop from 1 to 50 do let i=i+1 done echo $i What will be the output of the above script?
2450
1275
1225
2550
Consider the script "beach.sh" for i in $1; do if (( ${#i} > 4 )); then print -n "#$i " fi done beach.sh "On the beach at night, stands a child with her father"
#On the beach at night, stands a child with her father
#On #the #at #a #with #her
#beac #nigh #stan #chil #fath
#beach #night, #stands #child #father
A user types history command and gets the following output 141 cd .tcs 142 ll tcs.lst 143 pwd 144 vi tcs.lst 145 ll -lrt | awk '{ print $NF }' 146 echo "Test" 147 ps -ef | grep lsnr 148 grep a * 149 ls 150 echo $PWD Refering to the scenario above, which one of the following is not a method for recovering the pwd command
r 143
fc -e -r p
fc -e 143
r -8
Consider the script let i=2 while (( i <= ($l - 1) )); do if (( ($l % i ) == 0 )); then print $i $l $? break; fi let i=i+1 done What is the program all about and what are the possible outputs?
checks prime number; returns one when not prime and zero when prime
checks prime number; returns none when not prime and zero when prime
checks prime number; returns zero when not prime and one when prime
checks prime number; returns zero when not prime and none when prime