jaime@OpticaOmegaPlus:~$ echo 'date %T' >/tmp/midate; chmod rx /tmp/midate; /tmp/midate
chmod: invalid mode: ‘rx’
Try 'chmod --help' for more information.
-bash: /tmp/midate: Permission denied
Could someone tell me why it does not work
You're doing it wrong.
$ echo 'date +%T' >> /tmp/Temp_date && chmod +rx /tmp/Temp_date && /tmp/Temp_date
08:32:18
+
sign before rx
.+
sign before %T
to ensure it recognized by date
.midate
on /tmp
, that's why bash refuse to execute. As it was not valid script.+rw
(rather than =rw
for example)? Also AFAIK space after the redirection operator is optional.
Apr 10, 2019 at 1:56