-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash.sh
More file actions
38 lines (32 loc) · 819 Bytes
/
Copy pathbash.sh
File metadata and controls
38 lines (32 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Prints the value to the terminal
echo "Hello User"
# Basic variable declaration
my_string_var="String"
my_number_var=5
my_true_bool_var=True
my_false_bool_var=False
# Basic IF statement structure; notice I'm using the variable with a `$` preceeding it.
if [-z $my_string_var ]
then
echo "My Value is TRUE"
else
echo "My Value is FALSE"
fi
# Basic FOR LOOP structure
for i in {1..5} # this is a number range from 0 to 5
do
echo "Hello number $i!"
done
# Basic While statement structure
while [ $my_number_var -lt 5 ]
do
counter=$(( $my_number_var - 1 ))
echo "$my_number_var"
done
# Get all files ending with '.yml' and then move them into a new directory for '.yml' files
mkdir yaml_files_dir
for $i in $(ls *.yml)
do
mv $i ./yaml_files_dir/$i
done