sujay kumar


{ City }
< Country > india
* Profession *
User No # 4293
Total Questions Posted # 0
Total Answers Posted # 10

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 98
Users Marked my Answers as Wrong # 22
Questions / { sujay kumar }
Questions Answers Category Views Company eMail




Answers / { sujay kumar }

Question { IBM, 12567 }

What command would users use to see what file one
page at a time in UNIX?


Answer

pager filename

pg filename

less filename

more filename

cat filename | less or more..

Is This Answer Correct ?    7 Yes 0 No

Question { 9939 }

what is telnet?


Answer

Telnet is a kind of Remote Login Protocol.

Is This Answer Correct ?    3 Yes 1 No


Question { 30018 }

How to declare functions in unix shell script?


Answer

First method:

function function_name
{
}

Second Method:

function_name()
{
}

For both methods, the invocation of function would be in
the same format only.

Invocation:

function_name

Is This Answer Correct ?    62 Yes 12 No

Question { 5904 }

What is egrep?


Answer

Extended grep is called as egrep.

grep -E will do the same function as egrep

Is This Answer Correct ?    2 Yes 1 No

Question { 9619 }

Create a bash shell script to sort and then
uniq the file from the command line & store it to a new
file and output the results to the screen. Name this
script "sortAndUniq.sh"


Answer

sort $1 | uniq > output | echo "`cat output`"

Is This Answer Correct ?    1 Yes 2 No

Question { Polaris, 9880 }

How to group the commands in shell scripting?


Answer

(unix cmd 1; unix cmd2)

eg:

ubuntu@ubuntu:~$ (w > fname ; wc -l fname)
10 fname
ubuntu@ubuntu:~$

Is This Answer Correct ?    10 Yes 2 No

Question { 6226 }

What is the use of script interpreter in shell scripting?


Answer

To overcome the execution of your script by the default
shell, we are invoking the required script
interpreter(shell) in the script file to execute our script.

Is This Answer Correct ?    3 Yes 0 No

Question { 17617 }

How do you know about running processes of a particular
user?


Answer

ps -U username

ps U username

Is This Answer Correct ?    6 Yes 1 No

Question { 13275 }

Give a regular expression that finds two things, try to
come up with regular expressions that find each
individually using "egrep" command?


Answer

vjsujay@vjsujay-desktop:~/test$ cat jsk
cake
coke

vjsujay@vjsujay-desktop:~/test$ egrep 'c(a|o)ke' jsk
cake
coke

Is This Answer Correct ?    1 Yes 2 No

Question { 7218 }

how to read systems current date and time


Answer

#!/usr/bin/sh

echo "Sample Script to display current date & time"
date

Is This Answer Correct ?    3 Yes 1 No