Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • \$\begingroup\$ Do you actually need the $1? If the input is given as a command-line argument, isn't the 'program' just sips -r 90 (10 bytes)? \$\endgroup\$ Commented Feb 17, 2023 at 9:58
  • 1
    \$\begingroup\$ @DominicvanEssen To my knowledge, there is no way to implicitly do this without providing a positional parameter. In some CG asnwers, a script can read from STDIN - the stream gets piped to the first command in the script that reads it. But in this case the input is the filename, as we need to both read from and write to the input filename. Also, sips doesn't appear to read from STDIN \$\endgroup\$ Commented Feb 17, 2023 at 17:50
  • \$\begingroup\$ I'm not sure that I understood your explanation: typing sips -r 90 2iORu.png on my Mac seems to rotate the image file "2iORu.png" and overwrite the original (without using zsh). Isn't that the objective? \$\endgroup\$ Commented Feb 17, 2023 at 21:13
  • 1
    \$\begingroup\$ If you're typing sips -r 90 2iORu.png (presumably into the terminal), then you are using the shell, which zsh by default on modern MacOS. Thus my answer is a zsh shell script (that could be saved as a script file). Am I missing something? If I create a zsh script file with the content sips -r 90, it doesn't do what is required. \$\endgroup\$ Commented Feb 17, 2023 at 22:08
  • 1
    \$\begingroup\$ @DominicvanEssen I suppose one could submit an answer in the form of a shell alias alias r='sips -r 90', which may be run as r test.png then claim that the alias is only 10 bytes long... hmm, not a bad idea for this challenge actually \$\endgroup\$ Commented Feb 17, 2023 at 22:21