Originally Posted By: Hal Itosis
FWIW, here is my Cookie Counter pipeline command:
Code:
sed 's/[[:cntrl:]]//g' ~/Library/Cookies/Cookies.plist |
  awk -F. '/Domain/ { getline; print $(NF-1) "." $NF }' |
    sed 's/<[^<]*>//g' |sort -b -d -f -i |uniq -c |
      awk -v tot=0 '{ tot += $1; print $0 }
        END { print(" === =====================\n",
          tot, "cookies in", NR, "domains") }' |
            pr -3 -t -i100 -o1 -w96


Just paste that code into a text file named cc, make it executable (chmod a+x) and put it in your $PATH somewhere. Then simply typing cc in Terminal will display a true cookie count. [note: terminal window must be at least 96-chars wide to avoid wrapping, and even then, domain names longer than 26-chars will be truncated. E.g., facebookapplicationdevelopment.org will be printed as facebookapplicationdevelop.]

One could also copy/paste that text directly into Terminal... but it's much easier to save as a file and then just type cc

[either way, that pipeline is totally "safe" in that it only reads stuff... i.e., no data anywhere is altered one bit.]

Thanks for that, but what am I doing wrong?

Code:
Last login: Sat Jan 14 02:30:26 on ttys000
Artie-s-Computer-4:~ artie$ chmod a+x /Users/artie/Desktop/cc.txt 
Artie-s-Computer-4:~ artie$ 

and "cc" is still not executable.

And I'm afraid that "$PATH" is a bit beyond my experience; does it mean /bin?

(I'm prepping to start another thread that deals with cookies and will get into the "guts" of your command, but don't hold your breath.)


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire