I am new to shell scripting in Linux (1 year of computer science at school) and am having difficulties figuring out what is wrong with my script.#!/bin/bashecho Good Day $USERif [ -f $1 ]then     tar -cvf home-10-07-2017.tar --files-from /dev/null    echo You are about to back up the following files $*for i in $@do    if [ -f $i ]    then        PROCEED='YES'    else         PROCEED='NO'    fi      if [ $PROCEED='YES' ]    then        tar -rvf home-10-07-2017.tar $i    fidone        tar -vzf home-10-07-2017.tar.gzelse      echo 'You did not enter any files to backup'fiWhen I run script I get the following error./backups.sh first.txt second.txt Good Day fedYou are about to back up the following files first.txt second.txtfirst.txtsecond.txttar: You must specify one of the '-Acdtrux', '--delete' or '--test-label'      optionsAny help is much appreciated.Thanks in advance!
What's wrong with my bash script?
bash;shell script;fedora
The actual error from tar on the last line (which I guess was your primary question) is because you haven't specified an actual action. The f specifies that a filename follows. The v says to do something verbosely. The z says the file is compressed (and with most versions of tar is redundant).  I guess the action you wanted was t - to list the files. In which case, you'd need:  tar -tvzf home-10-07-2017.tar.gz