SilkyFalcon

Generation

linuxSat, 03 Dec 2022

command requires 2 arguments, the first one is a file name if it not exits send error and the second argument is a string what is the file will be removed to. If any args are missing send and error message

if [ $# -eq 2 ] ; then if [ -e $1 ] then echo "File $1 exists" echo "Moving $1 to $2" mv $1 $2 echo "Moving Successful" else echo "File $1 does not exist" fi else echo "Error, Wrong number of arguments" fi

Questions about programming?Chat with your personal AI assistant