Unix Shell Scripting Training

Unix Shell Scripting Training

Trending Questions and Lessons

Follow 4,803 Followers

Ask a Question

Feed

All

All

Lessons

Discussion

Lesson Posted on 23/05/2017 IT Courses/Unix Shell Scripting Training

Basics Of Unix

Dinesh Kumar Gupta

I am an experienced, qualified IT professional and Tutor with over 15 years of experience in mentoring...

What is Unix ? The Unix operating system is a set of programs that act as a link between the computer and the user. The computer programs that allocate the system resources and coordinate all the details of the computer's internals is called the operating system or the kernel. Users communicate with... read more

What is Unix ?

The Unix operating system is a set of programs that act as a link between the computer and the user.

The computer programs that allocate the system resources and coordinate all the details of the computer's internals is called the operating system or the kernel.

Users communicate with the kernel through a program known as the shell. The shell is a command line interpreter; it translates commands entered by the user and converts them into a language that is understood by the kernel.

  • Unix was originally developed in 1969 by a group of AT&T employees Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna at Bell Labs.

  • There are various Unix variants available in the market. Solaris Unix, AIX, HP Unix and BSD are a few examples. Linux is also a flavor of Unix which is freely available.

  • Several people can use a Unix computer at the same time; hence Unix is called a multiuser system.

  • A user can also run multiple programs at the same time; hence Unix is a multitasking environment.

Unix Architecture

Here is a basic block diagram of a Unix system :

Unix Architecture

The main concept that unites all the versions of Unix is the following four basics −

  • Kernel : The kernel is the heart of the operating system. It interacts with the hardware and most of the tasks like memory management, task scheduling and file management.

  • Shell : The shell is the utility that processes your requests. When you type in a command at your terminal, the shell interprets the command and calls the program that you want. The shell uses standard syntax for all commands. C Shell, Bourne Shell and Korn Shell are the most famous shells which are available with most of the Unix variants.

  • Commands and Utilities : There are various commands and utilities which you can make use of in your day to day activities. cp, mv, cat and grep, etc. are few examples of commands and utilities. There are over 250 standard commands plus numerous others provided through 3rd party software. All the commands come along with various options.

  • Files and Directories : All the data of Unix is organized into files. All files are then organized into directories. These directories are further organized into a tree-like structure called the filesystem
read less
Comments
Dislike Bookmark

Lesson Posted on 18/02/2017 IT Courses/Unix Shell Scripting Training

How to check disk group size veritas symantec and volume size script?

Ravindra Babu

Having 10+ years of experience in IT, Specialized in Redhat Adminstration , Solaris Adminstration, veritas...

#!/usr/bin/kshvxprint | grep Disk |awk {'print $3'} | grep -v rootdg >/var/tmp/dgnameprintf "\n......................................................................\n"printf "Server Name : "hostnamecat /var/tmp/dgname | while read dgnamesdoprintf "......................................................................\n"printf... read more

#!/usr/bin/ksh
vxprint | grep Disk |awk {'print $3'} | grep -v rootdg >/var/tmp/dgname
printf "\n......................................................................\n"
printf "Server Name : "
hostname
cat /var/tmp/dgname | while read dgnames
do
printf "......................................................................\n"
printf "\nDiskGroup Name : $dgnames "
vxprint -g $dgnames | grep ^dm |awk 'BEGIN {TOT=0} {TOT=TOT+$5} END{print " Total Size of the DG=" TOT/2/1024" MB ("TOT/
2/1024/1024" GB)\n"}'
vxprint -g $dgnames | grep ^v | awk '{print "Volume : " $2" " $5/2/1024 " MB (" $5/2/1024/1024 "GB)"}'
printf "\nAvailable space in $dgnames = "
vxassist -g $dgnames maxsize| awk '{print $5}'
done
printf "......................................................................\n" 

read less
Comments
Dislike Bookmark

Lesson Posted on 13/02/2017 IT Courses/Java IT Courses/Oracle Training/Oracle PL/SQL IT Courses/Unix Shell Scripting Training

Amazon written test for experience

Suresh

I have more than 4 years of professional experience in development and maintenance in Hadoop and Hadoop...

For the below written test answer I defined with "*" at the end of the options NULL is the same as 0 for integer the same as blank for character * the same as 0 for integer and blank for character the same as 0 for integer and blank for character The basic function of ____________ is... read more

For the below written test answer I defined with "*" at the end of the options 

NULL is

  • the same as 0 for integer
  • the same as blank for character       *
  • the same as 0 for integer and blank for character
  • the same as 0 for integer and blank for character

The basic function of ____________ is to search for files(or other units of text) that contain a pattern.

  • awk  *
  • search
  • cat
  • cmp

  What will be the output of the program?

class SSBool

{

    public static void main(String [] args)

    {

        boolean b1 = true;

        boolean b2 = false;

        boolean b3 = true;

        if ( b1 & b2 | b2 & b3 | b2 ) /* Line 8 */

            System.out.print("ok ");

        if ( b1 & b2 | b2 & b3 | b2 | b1 ) /*Line 10*/

            System.out.println("dokey");

    }

}

 

  • ok
  • dokey  *
  • No output is produced
  • Compilation error

  What does the literal “$?” mean in Shell script?

  • Exit status of the previous command executed
  • Exit status of the last command executed   *
  • Exit status of the first command executed
  • Exit status of the last command failed

  If 10 bulls can plough 20 identical fields in 3 days working 10 hours a day, then in how many days can 30 bulls plough 32 same identical fields working 8 hours a day?

  • 2  *
  • 4
  • 8
  • 10

 What will be the output of the following query? SELECT DECODE(TRANSLATE('A','1234567890','1111111111'),'1','YES', 'NO' ) from DUAL;

  • NO  *
  • YES
  • 1234567890
  • 1111111111

Table Employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE. The SQL statement prints? SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM Employee);

  • 10
  • 9  *
  • 1
  • 0

  What is the output of the following program?

x = 3; y = 5; z = 10;

if [( $x -eq 3 ) -a ( $y -eq 5 -o  $z -eq 10 )]

then

    echo $x

else

    echo $y

fi

 

  • 1
  • 3
  • 5
  • Error  *

A train running at the speed of 60 km/hr crosses a pole in 9 seconds. What is the length of the train?

  • 120 metres
  • 180 metres
  • 324 metres
  • 150 metres  *

Predict output of the following program

 

#include

typedef struct film{

    int size;

    int pixel;

    float price;

}xyz,pqr;

 

struct film *jadu(){

    static xyz one={231,12,900.0},*p=&one;

    return p;

}

 

int main(){

    pqr *ptr;

    ptr=jadu();

    printf("%d",ptr->pixel);

    return 0;

}

 

  • 231
  • 12  *
  • 900.0
  • Compilation error

What will be the output of the following query? SELECT REPLACE(TRANSLATE(LTRIM(RTRIM('!! ATHEN !!','!'), '!'), 'AN', '*'),'','TROUBLE') FROM DUAL;

  • ATHEN
  • **ATHEN
  • ATHEN***
  • None of the above  *

 

How will you list all the files within a directory including hidden files aka (.) dot files?

  • ls –a   *
  • ls –h
  • ls –q
  • ls –t

How to make any script file executable?

  • $chmod 655 *.sh
  • $chmod 765 *.sh
  • $chmod 755 *.sh  *
  • $chmod 754 *.sh

How to find current running processes in Unix server?

  • $ ps –ef *
  • $ ds –ef
  • $ du –ef
  • $ ls –ef

Bottom of Form

 

The least significant bit of the binary number, which is equivalent to any odd decimal number is

  • 0
  • 1   *
  • 1 or 0
  • None

Which OSI layer is responsible for Encryption and Decryption?

  • A) Network Layer   *
  • A) Network Layer
  • C) Data Link Layer
  • D) Presentation Layer

Which of the following memories has the shortest access time?

  • Cache memory *
  • . Magnetic Bubble memory
  • Magnetic core memory
  • RAM

Expand the following abbreviation – USB?

  • a) Universal sequence bit
  • b) Universal serial bus *
  • c) Universal sequence byte
  • d) Unique serial bit

How many times printf() will be executed in the below mentioned program? main() { int i; for (i = 0; i < 4; i++) fork(); printf(“my pid = %d\n”, getpid()); }

  • 4
  • 8
  • 16  *
  • 32

 

 What will be the output of the below program?

 

#include

int main(){

int far *p=(int *)0X70230000;

int far *q=(int *)0XB0210000;

int near *x,near*y;

x=(int near *)p;

y=(int near *)q;

if(x==y)

printf("Both pointer are equal");

else

printf("Both pointer are not equal");

 

    return 0;

}

 

  • Both pointers are equal
  • Both pointer are not equal
  • Segmentation fault
  • Compilation error  *

What is the difference between linux file system and windows file system?

  • A) Under Linux, the various partitions are detected at boot and assigned a drive letter whereas Under windows, unless you mount a partition or a device, the system does not know of the existence of that partition or device. *
  • B) Under Windows, the various partitions are detected at boot and assigned a drive letter whereas Under Linux, unless you mount a partition or a device, the system does not know of the existence of that partition or device
  • C) Under Windows, the various partitions are detected at reboot and assigned a drive letter whereas Under Linux, unless you mount a partition or a device, the system does not know of the existence of that partition or device
  • D) Under Windows, the various partitions are detected at reboot and assigned a drive letter whereas Under Linux, you mount a partition or a deviceBottom of Form

A bitwise operation 'f' has an interesting characteristic, such that, if f(a,b) = c, it always turns out to be the case that f(b,a) = c; f(a,c) = b; f(c,a) = b; f(b,c) = a; f(c,b) = a.

  1. a) Which of these functions could 'f' possibly be?
  • f(a,b) = a XOR b  *
  • f(a,b) = a + b
  • f(a,b) = a - b
  • f(a,b) = a * b

the following crontab file entry

0 17 * * 1,2,3,4,5 /usr/sbin/ckbupscd >/dev/console 2>1

The above entry says to run /usr.. at what time

  • 17 mins pass midnight
  • 5 pm on weekday of each month *
  • Midnight on the 17 day of each month
  • On the 17 day of each month at 1,2,3,4 and 5 pm

 

 How would you sort a file called shopping on column 3?

  • A) Sort –n 3 shopping
  • B) Sort –K 3 shopping *
  • C) Sort –c 3 shopping 
  • D) Sort –c3 shopping

What is the output of following program?

 

#include

void print(int n, int j)

{

   if (j >= n)

      return;

   if (n-j > 0 && n-j >= j)

       printf("%d %d\n", j, n-j);

   print(n, j+1);

}

 int main()

{

    int n = 8;

    print(n, 1);

}

 

  • 1 7 2 6 3 5 4 4 4 4   *
  • 1 7 2 6 3 5 4 4
  • 1 7 2 6 3 5
  • 1 2 3 4 5 6 7 8

 What is 2NF in normalization?

  • A) if the domain of each attribute contains only atomic (indivisible) values, and the value of each attribute contains only a single value from that domain.[
  • if all the attributes in a table are determined only by the candidate keys of that table and not by any non-prime attributes
  • If no non-prime attribute is dependent on any proper subset of any candidate key of the table  *
  • D) None of above

A train running at the speed of 60 km/hr crosses a pole in 9 seconds. What is the length of the train?

  • 120 metres
  • 180 metres
  • 324 metres
  • 150 metres  *

 Predict the output of the following program

 

#include

usingnamespacestd;

intmain()

{

    constchar* p = "12345";

    constchar**q = &p;

    *q = "abcde";

    constchar*s = ++p;

    p = "XYZWVU";

    cout << *++s;

    return0;

}

 

  • a
  • c
  • b
  • D) Garbage value  *

 Predict output of the following program

 

#include

using namespace std;

class Test

{

protected:

    int x;

public:

    Test (int i):x(i) { }

    void fun() const  { cout << "fun() const " << endl; }

    void fun()        { cout << "fun() " << endl;     }

};

 

int main()

{

    Test t1 (10);

    const Test t2 (20);

    t1.fun();

    t2.fun();

    return 0;

}

 

  • Compilation error
  • fun() fun()
  • fun() const fun()
  • fun() fun() const  *

 

   What does the following query find?

 

(SELECT DISTINCT r.sid

FROM boats b, reserves r

WHERE b.bid = r.bid

AND b.color = 'red')

MINUS

 (SELECT DISTINCT r.sid

FROM boats b, reserves r

WHERE b.bid = r.bid

AND b.color = 'green');

 

  • Find the sailor IDs of all sailors who have reserved red boats but not green boats
  • Find the sailor IDs of atleast one sailor who have reserved red boats but not green boats  *
  • Find the sailor IDs of at most one sailor who have reserved red boats but not green boats
  • None of the above

 

 

 Size of IPv6 address is

  • 4 bytes
  • 8 bytes
  • 6 bytes
  • 16 bytes  *

What is the probability of getting a sum 9 from two throws of a dice?

  • 1/6
  • 1/8
  • 1/9  *
  • 1/12

What will be output of following program?

 

#include

int main(){

static int a=25;

void cdecl conv1() ;

void pascal conv2();

conv1(a);

conv2(a);

return 0;

}

void cdecl conv1(int a,int b){

printf("%d %d",a,b);

}

void pascal conv2(int a,int b){

printf("\n%d %d",a,b);

}

 

  • 25 0 0 25
  • 25 25
  • Error will occur   *
  • 25 -99999999 -99999999 25

Which command puts a script to sleep untill a signal is received?

  • sleep
  • suspend   *
  • disown
  • break

 

read less
Comments
Dislike Bookmark

Looking for Unix Shell Scripting Training classes

Find best Unix Shell Scripting Training classes in your locality on UrbanPro.

FIND NOW

Lesson Posted on 08/12/2016 IT Courses/Unix Shell Scripting Training IT Courses/Unix

Unix Shell Scripting

Saravanan Baskaran

-Have 6 years of experience in providing ETL solutions using Ab Initio in BFS domain. -Have good knowledge...

UNIX Shell Scripting Unix – An Introduction:- Features & Advantages Unix Vs Linux Unix Architecture File Management Comparative study between Windows & Unix Vi Editor Unix – About the Shell:- Types of shells, Features I/O Redirection Operators Pipe Operator Filter... read more

UNIX Shell Scripting

Unix – An Introduction:-

  1. Features & Advantages
  2. Unix Vs Linux
  3. Unix Architecture
  4. File Management
  5. Comparative study between Windows & Unix
  6. Vi Editor

 Unix – About the Shell:-

  1. Types of shells, Features
  2. I/O Redirection Operators
  3. Pipe Operator
  4. Filter commands
  5. Command Line Editing & Usage
  6. History Mechanism

 Unix Shell Scripting:-

  1. Creating, Debugging & Executing shell scripts
  2. Shell & Environmental variable
    • Initialization and Scope
  3. Parameter Substitution
  4. Operators
    • Arithmetic
    • Relational
    • Logical
    • Boolean
    • File Test
    • String
  5. Flow control
    • If & If.. Else If Statements
    • While & Until Loop
    • For Loop
    • Select Loop
  6. Array Variables
  7. Built in script commands
    • eval & exec
    • break & continue
    • exit status

 Advanced Scripting:-

  1. Shell Initialization
    • Dot Files like .kshrc, .profile
    • Order of Execution
    • Aliases & Options
    • Predefined Shell Variables
  2. Positional Parameters & shift command
  3. Functions
read less
Comments
Dislike Bookmark

Lesson Posted on 22/10/2016 IT Courses/Red Hat IT Courses/Unix Shell Scripting Training Tuition/BCA Tuition +1 Tuition/BCA Tuition/Unix Shell programming less

Shell Scripting - The underrated programming language of system administrators

Shriharsh T.

"Knowledge Grows When Shared". I passed from Mumbai University and been with IT industry since 2009....

It is oft repeated that the next wave of IT is automation. But automation is not new - it existed before in terms of automated installation, sending birthday mails etc. It was not untill you actually work in large IT Infrastructure that you realise what is running in the background. The chances of... read more

It is oft repeated that the next wave of IT is automation. But automation is not new - it existed before in terms of automated installation, sending birthday mails etc. 

It was not untill you actually work in large IT Infrastructure that you realise what is running in the background. The chances of working on Unix / Linux servers in telecom, manufacture or banking is very high. And most of the routine tasks including installation and upgrade would be automated. You touch the shell scripting at this stage - directly or indirectly. 

The shell scripts are often confused with shell commands. That should not be the case. 

Shell commands forms the basis of the scripts. But as with other programming languages, shell scripts also have advanced concepts.

Also, there are no alternate to shell scripts if you want to have something automated in boot / console mode of unix / linux systems. 

Hence, sufficient knowledge of shells and related scripts is must for any system administrator to become a 'Pro' - now and in future. 

 

read less
Comments
Dislike Bookmark

Answered on 16/07/2016 IT Courses/Unix Shell Scripting Training IT Courses/Unix

I want to be an Expert in Shell Scripting. What is the path ?

Prasad Yamijala

Principal Consultant - IT Technical Training

Shell Scripting involved the usage of Unix commands, regex and Unix expressions.. You should be good at all the working commands, file permissions, filters and shell scripting features to become an expert
Answers 2 Comments
Dislike Bookmark

Looking for Unix Shell Scripting Training classes

Find best Unix Shell Scripting Training classes in your locality on UrbanPro.

FIND NOW

Answered on 19/06/2016 IT Courses/Unix Shell Scripting Training IT Courses/Unix

I want to be an Expert in Shell Scripting. What is the path ?

Sanjeev Tripurari

Professional Trainer:: Hadoop Big Data, DevOps ( No job support)

Check the man pages on your linux box and there is lot of free resource available, just search and play.. Still finding difficulty do a basic course
Answers 1 Comments
Dislike Bookmark

Answered on 07/12/2015 IT Courses/Unix Shell Scripting Training

Rahul Singh

Experienced in UNIX Shell

Hi Devi, Your while loop solution will not work for all the scenarios. 1. U have not used sort before uniq so in case of unsorted data, the code will not give proper output. 2. Actually we should avoid using while loop in pipe sequence since piping spawns a new shell every time, if you use or assign... read more
Hi Devi, Your while loop solution will not work for all the scenarios. 1. U have not used sort before uniq so in case of unsorted data, the code will not give proper output. 2. Actually we should avoid using while loop in pipe sequence since piping spawns a new shell every time, if you use or assign any variable some value inside that while loop, it's scope will only be inside the while loop even if the variable is assigned some initial value before the while loop. U cannot refer the new value of the variable outside the while loop. Since the shell in which while executed would be destroyed once the loop completes. read less
Answers 11 Comments
Dislike Bookmark

Answered on 03/04/2015 IT Courses/Unix Shell Scripting Training

Shivangi S.

Project Support and Professional Unix and Oracle training

Hi Nizar, To be able to create shell scripts, you should be first comfortable with Unix basic commands. I offer following two courses: 1) Unix Basics - covers all the useful Unix commands and utilities 2) Unix Shell scripting - covers the basics of Shell scripting After completing above two courses,... read more
Hi Nizar, To be able to create shell scripts, you should be first comfortable with Unix basic commands. I offer following two courses: 1) Unix Basics - covers all the useful Unix commands and utilities 2) Unix Shell scripting - covers the basics of Shell scripting After completing above two courses, you will become proficient in Unix commands and will be able to write shell scripts with ease. You will also be able to understand and edit the existing shell scripts written by any other developer. read less
Answers 18 Comments
Dislike Bookmark

Looking for Unix Shell Scripting Training classes

Find best Unix Shell Scripting Training classes in your locality on UrbanPro.

FIND NOW

Answered on 15/11/2014 IT Courses/Unix Shell Scripting Training

Jatin Miglani

Best Python Trainer

A shell script is a computer program designed to be run by the UNIX shell, a command line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, printing text, data processing,... read more
A shell script is a computer program designed to be run by the UNIX shell, a command line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, printing text, data processing, transforming data and process complex solutions. Shell scripting is necessary for Software Developers, Software automation testing and Application Support professionals read less
Answers 20 Comments
Dislike Bookmark

About UrbanPro

UrbanPro.com helps you to connect with the best Unix Shell Scripting Training classes in India. Post Your Requirement today and get connected.

Top Contributors

Connect with Expert Tutors & Institutes for Unix Shell Scripting Training

x

Ask a Question

Please enter your Question

Please select a Tag

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 25 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 6.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more