#! /bin/sh
##############
#Tarring files
##############
tar -czf $1.tar.gz $1
echo $1.tar.gz
exit 0

#! /bin/sh
##############
#Tarring files
##############
xargs tar -czf $1.tar.gz
&& echo $1.tar.gz
&& exit 0

Use xargs to pass stdin to tar and only execute subsequent commands if it was successful
Use xargs to pass stdin to tar and only execute subsequent commands if it was successful
