Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bash-scripting-assignment
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eric Arndt
bash-scripting-assignment
Commits
e41a9441
Commit
e41a9441
authored
Mar 29, 2021
by
vagrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BSA-00] (ArndtED) Adds solution to 3
parent
03dde3cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
solution3
bash-scripting/solution3
+10
-8
No files found.
bash-scripting/solution3
View file @
e41a9441
#!/bin/bash
#Assignment 3: Create a script to capitalize given file names if they are present in the present working directory
PARENT_PATH
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
;
pwd
-P
}
)
for
givenName
in
cat
$1
[[
-z
$1
]]
&&
echo
"No input arguments provided"
&&
exit
1
for
givenName
in
"
$@
"
do
#for fileName in $PARENT_PATH
#do
# echo "I am working"
# if [[ $givenName == $fileName ]]; then
# echo "${fileName^^}"
# fi
# done
if
[[
-f
$givenName
]]
then
echo
${
givenName
^^
}
else
echo
"No file by name
$givenName
exists in this directory."
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment