I am trying to find a standard POSIX way to duplicate one file's permissions to another file. On a GNU system this is easy:
[alexmchale@bullfrog ~]$ ls -l hardcopy.*
-rw-r--r-- 1 alexmchale users 2972 Jul 8 20:40 hardcopy.1
---------- 1 alexmchale users 2824 May 14 13:45 hardcopy.4
[alexmchale@bullfrog ~]$ chmod --reference=hardcopy.1 hardcopy.4
[alexmchale@bullfrog ~]$ ls -l hardcopy.*
-rw-r--r-- 1 alexmchale users 2972 Jul 8 20:40 hardcopy.1
-rw-r--r-- 1 alexmchale users 2824 May 14 13:45 hardcopy.4
Unfortunately, the --reference flag to chmod is a non-standard option. So that is out for my purposes. I would prefer it to be a one-liner, but that's not necessary. Ultimately, it does need to be in POSIX sh syntax.