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*

4
  • \$\begingroup\$ The examples of more than two letters are not valid; the OP said that "the program must be valid after any circular shift". So, arj/jar is not valid, as there is no rja command (although I like this example). +1 for the script - really nice idea :) \$\endgroup\$ Commented Jun 23, 2012 at 21:17
  • \$\begingroup\$ Since I was unsure, and not a native English speaker, I consulted a dictionary, where I found it ambiguous, to either mean every, or to mean a random one. The example with shift left by 6, left by 1 and right by 10 assured me in the interpretation, that I just need to find a single shift possibility. \$\endgroup\$ Commented Jun 24, 2012 at 2:00
  • \$\begingroup\$ It is not ambiguous. If a program has to be valid after some random shift, then it must also be valid for every possible shift. \$\endgroup\$ Commented Jun 24, 2012 at 16:06
  • \$\begingroup\$ @Griffin: Okay - you wrote the question. I removed the longer examples; fortunately there are enough crptc abbrv prgnms in unix like gs and sg. :) Btw.: Are you a native Englisch speaker? In the sentence before, you wrote ... in any language ... - my solution only works in bash (and sh, zsh, ash and a few else), but all those other solutions take program names too. \$\endgroup\$ Commented Jun 24, 2012 at 20:19