Top Shell Script Interview Questions :: ALLInterview.com http://www.allinterview.com Top Shell Script Interview Questions en-us How to declare functions in unix shell script? http://www.allinterview.com/showanswers/15805.html function Dissplay () { echo "This is how we define function" } Display # Invoking Function ## Function should be defined before we invoke it What is the syntax of &quot;grep&quot; command? http://www.allinterview.com/showanswers/15807.html syntax of "grep" command syntax: grep {word to lookup} {filename} Ex: grep man test How Connect to a Database in Shell Programming? http://www.allinterview.com/showanswers/13071.html you have a "sqlplus" command to connect to database. command is as follows: sqlplus <db_username>/<db_password> @test.sql What is the syntax of &quot;expr&quot; command? http://www.allinterview.com/showanswers/15813.html it is used to use arithmatic operation in shell scripting stntx: expr op1 opertor op2 where op1 and op2 may be any integer no(without any decimalpoint)and operator can be + Addition - Subtraction / division % Modular \* Multiplication what is &quot;umask&quot;? http://www.allinterview.com/showanswers/13698.html umask is used to set the default directory/file access restriction during it creation. For example: In '.profile' if you use 'umask 033' then if you create any file/directory that will be in 'rwx-r--r--' How to rename all the files in a folder having specific extension? E http://www.allinterview.com/showanswers/66952.html Hi Nagesh, Thanks for the reply but I dont think this will work as $file= myFile.txt and mv $file $file.my will rename to myFile.txt.my I found the solution by extracting basedirectory and filename then renaming it to req. extension. th write a shell script to identify the given string is palindrome or n http://www.allinterview.com/showanswers/13072.html set -x input_string=$1 if [ -z "$input_string" ] ; then echo "Please enter a Text along with the script name\n" exit fi reversed_string=$(rev $input-string) if [ "$input_string" -eq "$reverse_string What is the basic difference you find between a shell script and per http://www.allinterview.com/showanswers/13068.html Shell script is platform(OS) only for Unix flavour,dependent whereas perl is OS independent In shell scripting if text is surrounded by single quotes what does http://www.allinterview.com/showanswers/15814.html 'Single Quote' preserves all special characters within STRING. like when we use \a \b \t inside the string in shell script. what do u mean by $#,$* in unix programming? http://www.allinterview.com/showanswers/57776.html $# - number of command line arguments or positional parameters $* - All of the positional parameters, seen as a single word How u convert string &quot;hi pravin how are you?&quot; to &quot;Hi P http://www.allinterview.com/showanswers/78197.html Dear amlan Iwant answer which work for any string given. If you have a string &quot;one two three&quot;, which shell command http://www.allinterview.com/showanswers/13077.html Cut command Create a bash shell script that removes all files whose names end wi http://www.allinterview.com/showanswers/15811.html #/bin/bash rm `find . -name *~` write a shell script that counts a number of unique word contained i http://www.allinterview.com/showanswers/76028.html #!/bin/csh # Here tr -s ' ' replaces all multiple ' ' with single ' ' # next pipe the above stream to replace each ' ' with '\n' # next pipe the above stream to get a sorted list of words # then p How to group the commands in shell scripting? http://www.allinterview.com/showanswers/15815.html (unix cmd 1; unix cmd2) eg: ubuntu@ubuntu:~$ (w > fname ; wc -l fname) 10 fname ubuntu@ubuntu:~$