Skip to content

Commit

Permalink
wrote script to make directoary and file also console logged that fil…
Browse files Browse the repository at this point in the history
…e and directory were actually made
  • Loading branch information
mallorysmith64 committed Nov 18, 2019
1 parent f59dec7 commit 37d3c44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions hello/world.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
23 changes: 15 additions & 8 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,22 @@


#Simple Function: must call function after curly brackets
function sayHello() {
echo "Hello, people!"
}
# function sayHello() {
# echo "Hello, people!"
# }

sayHello
# sayHello

#Function with positional parameters:
function greet() {
echo "I am $1, and I am $2 years old."
}
# function greet() {
# echo "I am $1, and I am $2 years old."
# }

greet "Brad" "36"
# greet "Brad" "36"


#Create Folder and Write to File: first echo writes to file created, 2nd echo consoles response
mkdir hello
touch "hello/world.txt"
echo "Hello World" >> "hello/world.txt"
echo "Created hello/world.txt"

0 comments on commit 37d3c44

Please sign in to comment.