From 69fed59e373a116aa8e96eb05122eccbd431bce3 Mon Sep 17 00:00:00 2001 From: karanagarwal12 Date: Sat, 16 Mar 2024 03:49:00 +0530 Subject: [PATCH 1/2] colors added, issue #9 --- scripts/color | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/color b/scripts/color index d6a4fe8..aeab8e0 100755 --- a/scripts/color +++ b/scripts/color @@ -9,7 +9,14 @@ 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 @@ -17,4 +24,3 @@ if [[ $1 == 'reset' ]]; then else color 1 ${color_mapping[$1]} fi - From 17d487387eae7f0081f72187bad6e0fbc1605d3a Mon Sep 17 00:00:00 2001 From: karanagarwal12 Date: Sat, 16 Mar 2024 04:02:37 +0530 Subject: [PATCH 2/2] written the script to obtain permissons of files --- scripts/perms | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/perms b/scripts/perms index b683156..30acf88 100755 --- a/scripts/perms +++ b/scripts/perms @@ -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