Process multiple items in command line

Posted on December 8th, 2007 by hamstar

This is great, I saw it somewhere the other day but can’t remember where. It is pretty simple too… sometimes when I do stuff on the command line with cut I try to run multiple commands on the output, but it never works cos I try to it with sed but with this method it works great.

Check it out:

for i in `ps auwx|grep hamstar|cut -f2 -d’ ‘`; do kill $i; done

That would kill all the processes that I have started under my username. Notice the red part is where it takes all the entries (puts each one into $i as it uses it, and the blue part is where it does something with the entries ($i again)). Adding kill to the start and ; to the end using sed would not work for this.

Ok that might a bit tricky for some of you, especially if you haven’t come across the miracle of piping yet, let me show you a simpler one.

for i in *; do echo $i; done

Basically another form of ls but thing of the things you can do with this. Rename from lowercase to uppercase:

for i in *; do mv $i `echo $i|tr [A-Z] [a-z]`; done

So its basically limitless to what you can do with this cool thing.

I also found another cool thing while writing this. Doing the following will covert all characters in a given file to lowercase or uppercase if you changed it:

dd file.txt conv=lcase

Tags: , ,

Satanism

Posted on December 3rd, 2007 by hamstar

So I’ve been checking out various “sects” of satanism lately, and it is surprisingly awesome.  Some of it makes sense and people in this day and age seem to live like that anyways.  Black Masses and human sacrifices are a thing of the past, only used in the 70s for the shock factor.

There are a few different versions of satanism, some make more sense than others, and some are more like actual religions than philosophies.

LaVayen Satanism seems to be the most thought out one, with a Church, a Book, 9 Satanic sins and 11 “commandments” (Satanic Rules). 

Oddly enough LaVeyan satanism doesn’t actually worship Satan or the Devil as a God or Deity.  LaVeyan satanism firmly believes that all Gods are created by man, therefore the worship of those gods is is merely worshiping of man himself by proxy.  Therefore they cut out the middle man altogether and state that we should worship the divinity within onself, putting man, and one self at the highest priority and thinking of satan as the animal instincts within ourselves.
Read more »

Tags: ,