filename=sample.txt file=${filename%.*} echo $file $file now contains
txt
sample
.txt
sample.
How to call the function function1 in shell
function1()
call function1
function1
ask function1
What are the ways to get the filename from the absolute path in a variable Mypath=/my/path/file
filename=basename Mypath
basename Mypath
filename =file Mypath
file Mypath
filename = ${Mypath#///}
echo $Mypath | awk ‘ FS=”/” { print $4 } ‘
Which variable contains the return value of last executed command
$!
$?
$#
$@
which operator is used for testing condition
check
test
expr
find
Which variable holds the values of command line parameters
$*
which variable holds the number of values of comman line parameters
ksh shell was developed by
Korn Matt
Karthick Subramanian
David Korn
Kandasamy
How can you append the output of a command to a file?
command << file
command > file
command <> file
command >> file
Using which command you can see your user name?
whoami
pwd
who
uname