Skip to main content
6 events
when toggle format what by license comment
Mar 8 at 11:07 comment added Chris For anyone else, someone just told me that the string sh is used in error reporting, so the reason the second sh is always sh, even though it is just to use up $0, is because sh tells the reader that it is the sh -c command that generated the error message.
Mar 7 at 14:29 comment added Chris Very helpful indeed, thank you! I also needed this excellent answer to understand that sh could be any string, not necessarily the sh command, and find normally passes a filename at a time which is what + changes to many filenames in one call, and the {} is where find interpolates the filename/s. The second sh bit caused some head scratching!
Mar 4 at 15:17 comment added glenn jackman @Chris, is that helpful?
Mar 4 at 15:17 history edited glenn jackman CC BY-SA 4.0
added 565 characters in body
Mar 4 at 14:43 comment added Chris Can anyone explain 'The 2nd "sh" will become the $0 inside the spawned shell' please? I understand that the filenames all populate f from $@, but where does the sh as $0 come in? Thanks
May 7, 2019 at 14:56 history answered glenn jackman CC BY-SA 4.0