0

I have a small shell script that starts a program when I double-click it. (I have set the permissions to allow executing the script).

I want to be able to copy that script to another computer so that the new user can double-click it without needing to know anything about chmod or permissions. But I can't find out how to preserve the execute permission when I copy the file.

I can usually find answers with Google but this has me defeated - I guess I am not expressing my question properly.

Thanks

  • I seem to have stumbled on the answer. I was losing the executable status because I was copying the shell script onto a FAT formatted USB stick. By using TAR as suggested below, the status was preserved if I extracted the file with Archive Manager without using TAR. – user1434691 Jun 06 '12 at 16:22

1 Answers1

2

Use rsync or tar.

rsync -p file user@host:destdir

plus other options you might need.

Or

tar cvzf file.tar file

then copy (or email, etc.) file.tar to the other machine and extract the file:

tar xpvzf file.tar
Dennis Williamson
  • 346,391
  • 90
  • 374
  • 439