Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission of files functionality done, issue #6 #46

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/color
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ color() {
declare -A color_mapping=(
# TODO: Add more color values
# Refer bash color codes
['black']=30
['red']=31
['green']=32
['yellow']=33
['blue']=34
['magenta']=35
['cyan']=36
['white']=37
)

if [[ $1 == 'reset' ]]; then
color 0 00
else
color 1 ${color_mapping[$1]}
fi

8 changes: 8 additions & 0 deletions scripts/perms
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@
# 775 weather
# 664 ../README.md

for file in "$@"; do
if [ -e "$file" ]; then
permissions=$(stat -c "%a" "$file")
echo "$permissions '$file'"
else
echo "File '$file' does not exist."
fi
done