A previous question of mine asked how to pipe downloaded files through tar, now I would like to know how to pipe the output of tar through mv. See I have this command at the moment:wget -c https://github.com/JeffHoogland/moksha/archive/0.1.0.tar.gz | tar -xzand this creates a directory called moksha-0.1.0, but I would like to know how I might rename this output directory as moksha, perhaps via a pipe (|) at the end of this command. Although if you know how to do this without a pipe, but still on the same line of code as wget and tar, I will be happy to accept it too. To be clear I know that:wget -c https://github.com/JeffHoogland/moksha/archive/0.1.0.tar.gz | tar -xz -C mokshawill create an output directory moksha but within this output directory there will be the moksha-0.1.0 directory, rather I want to rename this moksha-0.1.0 directory as moksha, instead of placing moksha-0.1.0 in a new directory called moksha.
How do I pipe the output of tar through mv?
shell script;pipe;tar;mv
Like this?[root@b se]# wget -cqO - https://github.com/JeffHoogland/moksha/archive/0.1.0.tar.gz | tar -xz --transform=s/moksha-0.1.0/moksha/[root@b se]# lsmoksha[root@b se]# ls mokshaABOUT-NLS       config.guess          debian                 Makefile.amaclocal.m4      config.guess.dh-orig  depcomp                Makefile.inAUTHORS         config.h.in           doc                    missingautogen.sh      config.rpath          enlightenment.pc.in    netwm.txtautom4te.cache  config.sub            enlightenment.spec.in  NEWSBACKPORTS       config.sub.dh-orig    INSTALL                poBUGS            configure             install-sh             READMEChangeLog       configure.ac          intl                   srccompile         COPYING               ltmain.sh              xdebug.shconfig          data                  m4                     x-ui.shFrom the tar manual page:--transform=EXPRESSION, --xform=EXPRESSION    Use sed replace EXPRESSION to transform file names.So sed is probably required for this to work. Though if you have wget, you probably have sed as well.