Skip to main content

Shell Programming

                              SHELL PROGRAMMING

When a group of commands has to be executed regularly, they should be stored in a file,
and the file itself executed as a shell script or shell program. Though it’s not mandatory,
we normally use .sh extension for shell scripts.

A shell program runs in interpretive mode. It is not compiled into a separate executable file as a C program is. Each statement is loaded into memory when it is to be executed.

Installing any Ubuntu/Linux package using the command:

sudo apt-get install [package_name]

Ex: 
       To install gedit editor
          >-sudo apt-get install gedit
      Creating a file in gedit editor
          >-sudo gedit [file_name]
      Ex:
          >- sudo gedit shell_program_1.sh

Few Examples Of Shell Codes:
1
............................................................................................................
shell_program_1.sh
............................................................................................................
............................................................................................................
For Execute Type: 
>-sh shell_program_1.sh 
in the Terminal.

2
............................................................................................................
shell_program_2.sh
............................................................................................................
............................................................................................................
Execute: sh shell_program_2.sh
............................................................................................................




In the Next Blog, We will Discuss Some more Shell Codes.














Comments

Post a Comment

Popular posts from this blog

Postfix Evaluation(Single or Multi Digit) using STACK in C

POSTFIX EVALUATION WITH SINGLE OR MULTI DIGIT: Students find difficulties in finding the correct code for Postfix evaluation using Stack which works for Single as well for multidigit also; So here is the Question Format Given::- Question_2; Data_Structure:  Write a C program to evaluate the following POSTFIX expression. Use STACK to solve this problem.  INPUT: 5 6 2 + * 12 4 / -  OUTPUT: 37 Basic Understanding: Here is the Correct code:

STACK in C

IMPLEMENTATION OF STACK USING ARRAY Here is Example of Source Code of Data Structure-1, Question 1: Data_structure :  Write a C program to implement STACK using an array. This program must include the following functions in it. Write a function for “Push” operation.   Write a function for “Pop” operation.  Write a function for “Display” operation which prints the content of the STACK.    Basic Understanding : Push and Pop Operation: Here is How to Implement:                                                   

Insomnia : A Sleep Disorder, Symptoms, Cause and Remedies

DEFINITION:  Insomnia is a sleep disorder in which you have trouble falling or staying asleep.  The condition can short-term (acute) or can last a long time (chronic). It may also come and go.  Acute insomnia lasts from 1 (one) night to a few weeks. Insomnia is chronic when it happens at last 3 (three) nights a week for 3 (three) months or more. CHARACTERISTICS: ·         Difficulty falling asleep at night. ·        Waking up during the night. ·        Waking up too early. ·        Not feeling well-rested after a night's  sleep . ·        Daytime tiredness or sleepiness. ·        Irritability, depression, or anxiety. ·        Difficulty paying attention, focusing on tasks or remembering. ·        Inc...