(no subject)

Date: 2004-03-10 02:12 am (UTC)
From: [identity profile] keirf.livejournal.com
Now if he'd put 'find' down as a skill I could understand that. Now there's a command that's hard to use.

(no subject)

Date: 2004-03-10 04:24 am (UTC)
pm215: (Default)
From: [personal profile] pm215
[You've probably seen this before, but I still think it's neat...]
#!/bin/sh
cd /tmp && mkdir t && cd t && find . -noleaf -path . -exec mkdir 2 \; \
-printf '2\n' -o -name 100n -o  -exec sh -c "find . -path . -o -name '*n' \
-o -exec expr \( \( \( {} : '.*/\([^n]*\)' \) + 1 \) / \{\} : '.*/\(.*\)' \
\) \* \{\} : '.*/\(.*\)' - \( {} : '.*/\([^n]*\)' \) - 1 ';' | grep '^0$' \
>/dev/null " \; -exec sh -c "mkdir {}/\`expr {} : '.*/\([^n]*\)' + 1\`n" \
\; -o -exec sh -c "mkdir {}/\`expr {} : '.*/\([^n]*\)' + 1\`" \; -exec sh \
-c "echo \`ls {}\`" \; && cd /tmp && rm -r t 

November 2025

S M T W T F S
      1
2345678
91011121314 15
1617 181920 2122
23242526272829
30      

Most Popular Tags

Expand Cut Tags

No cut tags