July 2018
Beginner
264 pages
8h 9m
English
Let's begin our activity as follows:
#!/bin/bashFILE_TO_TEST=""function permissions() { echo -e "\nWhat are our permissions on this $2?\n" if [ -r $1 ]; then echo -e "[R] Read" fi if [ -w $1 ]; then echo -e "[W] Write" fi if [ -x $1 ]; then echo -e "[X] Exec" fi}function file_attributes() { if [ ! -s $1 ]; then echo "\"$1\" is empty" else FSIZE=$(stat --printf="%s" $1 2> /dev/null) RES=$? if [ $RES -eq 1 ]; then return else echo "\"$1\" file size is: ${FSIZE}\"" fi fi if [ ! -O $1 ]; then echo -e "${USER} is not the owner of \"$1\"\n" fi if [ ! -G $1 ]; then echo -e "${USER} is not among ...Read now
Unlock full access