uuencode & uudecode - permissions

$ ls -l example_1.sh
-rwxr--r-- 1 vsetm7am nofiles 918 Sep  5 19:54 example_1.sh
$ stat -c %a example_1.sh
744
$ uuencode "test.file" <example_1.sh >uuexample.uu
$ uudecode uuexample.uu
$ ls -l test.file
-rw-r--r-- 1 vsetm7am nofiles  918 Sep  7 14:44 test.file

How come that the user "lost" permission to execute file? Is it some kind of protection against bad apps/scripts? I didn't find a note in man page of uuencode.

Thank you!

You are redirecting from standard input, so uuencode doesn't see a file, just a stream of bytes. Maybe try passing it a file name argument (remove the <) or change the permissions on the BEGIN line in the uuencoded file with a simple sed script.

2era: you're right thank you! :slight_smile:
(Changing via sed script wouldn't be problem but I didn't understand the behaviour and that was what confused me)

Well teacher said that pipe connects stdout of first program with stdin of the second program and I thought it's not so simple and that there're some other values that pipes sends but obviously I was wrong..