-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariable.sh
More file actions
executable file
·17 lines (13 loc) · 821 Bytes
/
variable.sh
File metadata and controls
executable file
·17 lines (13 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/bash
# this is a comment
echo "Variables" #this is also a comment
echo $BASH #this is a varible of name of the bash or shell
echo $BASH_VERSION #this is a varible of version of the bash or shell
echo $HOME #this is a varible of home directory
echo $PWD #this is a varible of present working directory
# user defined variables
name=Madhusha
echo "The name is $name" # this is a user defined variable callinng
echo "The name is ${name}" # this is a user defined variable callinng and other way of calling is ${name}
echo The name is $name # this is a user defined variable callinng another way
10val=10 # this is not a valid variable name because it starts with a number, when we run this script it will give an error, we must start a variable name with a letter or an underscore