Scripts - Study24x7
Social learning Network

Welcome Back

Get a free Account today !

or

Forgot password?

By Registering, you agree to our Privacy Policy and Terms of use.

scripts Cover image
scripts
Scripts
  • Followers
  • Latest Feeds
  • Articles
  • Question
  • Course
  • About
  • Review
Interests
Scripts
12 followers study24x7 03 Feb 2019 10:16 PM study24x7 study24x7

Use of square brackets is necessary in bash for if statements.
The basic syntax of if..then statement is:

#!/bin/bash
if [ condition ]
then
<commands>
fi

If you have many if statements(nested if) inside your script,then with proper indenting syntax is:

#!/bin/bash
if [ condition ]
then
<commands>
if [ condition ]
then
<commands>
fi
fi

study24x7
Write a comment
12 followers study24x7 14 Jan 2019 11:39 AM study24x7 study24x7

A shell script contains a sequence of commands for a UNIX-based operating system. It's called a shell script because it combines into a "script" in a single file a sequence of commands that would otherwise have to be presented to the system from a keyboard one at a time.Thus , a very useful tool in automating tasks in Linux OSes. All scripts can be run without the need of compiling it, so the user will have a way of prototyping commands seamlessly.
The bash (Bourne-Again Shell) is the default shell in most of the Linux distributions and OS X. It was developed by Brian Fox and was released in 1989.
Every Linux script starts with a shebang (#!) line. The bang line specifies the full path /bin/bash of the command interpreter that will be used to run the script.

study24x7
Write a comment
About
Ratings
5.0
out of 5
1 Ratings
5 study24x7
 
1.0
4 study24x7
 
0.0
3 study24x7
 
0.0
2 study24x7
 
0.0
1 study24x7
 
0.0
Related Pages

Topline Coaching

3230 followers

General Science and ..

2529 followers

Just Asking - Lets c..

1892 followers

Daily Current Affair..

1820 followers

Learn N Share - Get ..

1612 followers

General Knowledge An..

1552 followers

English with Astute ..

1486 followers

GOVERNMENT JOB NOTIF..

1379 followers

SSC 2021 Preparation..

1328 followers

RAU IAS COACHING

1322 followers

Uphaar Classes - By ..

1194 followers

UPSC Civil Services ..

1160 followers

Psychology decoded

1145 followers

Ashok Meena

1112 followers

TARGET SUCCESS

1114 followers

UPSC & State PSC..

887 followers

Abhiyan Civil Servic..

856 followers

Study24x7

845 followers

Maths

712 followers

Reasoning with Rizwa..

711 followers

Maths By Uttam Sir

695 followers

Results Alert

648 followers