Move/copy files/folder in linux/solaris using only bash built-ins

Posted by KullDox on Stack Overflow See other posts from Stack Overflow or by KullDox
Published on 2010-04-07T18:49:25Z Indexed on 2010/04/07 18:53 UTC
Read the original article Hit count: 189

Filed under:
|
|

There was a situation when somebody moved the whole rootdir into a subdir on a remote system, thus all the system tools like cp, mv, etc didn't work anymore. We had an active session though but couldn't find a way to copy/move the files back using only bash built-ins.

Do somebody know of a way to achieve this?

I even thought about copy the cp or mv binary in the currentdir with

while read -r; do echo $LINE; done

and then redirect this to a file, but it didn't work. Guess because of all the special non printable chars in a binary file that can't be copied/displayed using echo.

thanks.

© Stack Overflow or respective owner

Related posts about bash

Related posts about linux