Skip to main content

Timeline for Why is $'\0' the same as ''?

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
Jan 14, 2013 at 1:33 answer added Gilles 'SO- stop being evil' timeline score: 6
Jan 12, 2013 at 16:15 comment added slhck @ChandraRavoori In that case, use find … -exec sh -c '…' {} ';'. Here, within sh -c you can call the file as the argument and even use multiple lines. See Gilles' answer here for more: unix.stackexchange.com/a/9500/5893
Jan 12, 2013 at 16:13 comment added iruvar @slhck, thanks. What about situations involving multi-step operations on each file where a loop may be preferable for readability reasons? Is there a better loop option than the "naïve way" above?
Jan 12, 2013 at 16:06 comment added slhck @ChandraRavoori Yes, for example by using find … -exec instead of looping around files, which works for most cases where you'd use such a for loop instead. Here, find takes care of everything for you.
Jan 12, 2013 at 16:04 comment added slhck @htor I know for i in $(ls) is terribly stupid—I'm almost ashamed I used it as a bad example here.
Jan 12, 2013 at 16:01 comment added user13742 By the way if you want to do safe operations iterating over a set of files - use for f in * instead of parsing ls.
Jan 12, 2013 at 15:44 comment added iruvar Referring to the "naïve" way, is there a better way of doing this?
Jan 12, 2013 at 10:03 history tweeted twitter.com/#!/StackUnix/status/290036184833478656
Jan 12, 2013 at 9:08 vote accept slhck
Jan 12, 2013 at 8:25 answer added michas timeline score: 10
Jan 12, 2013 at 8:15 history asked slhck CC BY-SA 3.0