?

Log in

No account? Create an account
More *nix Scripting - Multiplayer vi [entries|archive|friends|userinfo]
Tomas Gallucci

counter customisable

[ flavors | Meta Profile ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Links
[Links:| Value for Value Politics Tech Reads ]

More *nix Scripting [Nov. 10th, 2009|12:53 pm]
Tomas Gallucci
[Tags|, , , , ]

I've been meaning to post this for a while, but ever time I think of it, I'm at home and I can't get to this script--incompatibility with Snow Leopard and our network.

The trick that made this script useful for me (and saved me from having tor really think outside of the box) was basename

I know I need to comment this script so they know who to come sue when it doesn't work and actually explain what the hell is going on here, but I wanted to hear from my *nix versed readers.

I'm also considering x-posting to unixadmin for recommendations on how to clean up the script or what kind of things I should add. For instance, a suggestion was made to check for 0 byte files. Also, it seems like on the day, just echo didn't produce a blank line. I considered echo \n but I didn't think that would work either.

Nevertheless, here's my latest script made public for review, critique and criticism.



#! /bin/bash

for x in `ls |grep backup`

	do
		echo Creating DB `basename $x .backup`
		createdb -E SQL-ASCII -O libsoft `basename $x .backup`
							

		echo restoring `basename $x .backup`
		pg_restore --no-owner -d `basename $x .backup` $x

		echo NEXT
	done
linkReply

Comments:
From: snapper521
2009-11-10 06:57 pm (UTC)
Boring.
(Reply) (Thread)
[User Picture]From: schpydurx
2009-11-10 07:00 pm (UTC)
Do you even know what this script does?
(Reply) (Parent) (Thread)
From: snapper521
2009-11-10 07:21 pm (UTC)
Nope but I don't care.
(Reply) (Parent) (Thread)
[User Picture]From: schpydurx
2009-11-10 07:24 pm (UTC)
Clearly.
(Reply) (Parent) (Thread)
[User Picture]From: schpydurx
2009-11-10 07:25 pm (UTC)
That begs the question: if you have no idea what the script does, how can you call it boring?
(Reply) (Parent) (Thread)
From: snapper521
2009-11-10 07:27 pm (UTC)
Because computer script IS boring to me. Just as Medical, horse, dulcimer and most everything else that I find interesting or fun to do you find boring.
(Reply) (Parent) (Thread)
[User Picture]From: schpydurx
2009-11-10 07:28 pm (UTC)
Maybe you're just boring.
(Reply) (Parent) (Thread)
From: snapper521
2009-11-12 07:23 pm (UTC)
Takes one to know one...
(Reply) (Parent) (Thread)
[User Picture]From: schpydurx
2009-11-12 07:26 pm (UTC)
bunny[1]
(Reply) (Parent) (Thread)
From: snapper521
2009-11-14 08:29 pm (UTC)
Speaking of pancakes, mom says she has a foolproof recipe for pancakes if you care to give it a try. Having burned pancakes gets to be real old, real fast...
(Reply) (Parent) (Thread)
[User Picture]From: schpydurx
2009-11-14 09:11 pm (UTC)
Tell her to send it on.
(Reply) (Parent) (Thread)
From: snapper521
2009-11-16 11:36 am (UTC)
See if I can't dig it up for you. She isn't home at the moment as she is working... imagine that an adult actually working for a living instead of pretending to work like someone else I could think of...

A website that is good for finding recipes is: http://allrecipes.com/ Mom uses it all the time when she wants to find something or alter a recipe she already has. Pretty good at the recipe alteration... She made apple dumplings to die for the other day by combining 3 recipes. (I'm assuming you know what those are...)

She was wondering if you liked fruit on your pancakes? She has a recipe for "Apple cider syrup" if you do but said to tell you not to try and make it, that she would just give you a jar if you wanted some. Tastes pretty good. Like putting spiced cider on your pancakes.

Pancakes
1c. sifted flour
1 c. milk
1 egg
2 tablespoons vegetable oil

1. Beat eggs, oil, and milk together, and add to flour. Stir until combined.
2. Heat a greased griddle until drops of water sprinkled on it evaporate noisily. Pour 1/8 to 1/4 cup batter onto the griddle. Turn over with a metal spatula when bubbles begin to form on top. Cook second side to a golden brown color.
(5 servings; 10 4-inch pancakes)

I haven't tried this one, Mom pulled it off the recipe site and it was laying here on the desk, but it looks like it would be good. The only thing is that I don't know as you would have all of the ingredients. Bachelors kitchen and all that.
Truck-stop buttermilk pancakes
5 eggs
1 1/2 c. milk
6 tablespoons butter; melted
5 c. buttermilk
5 c. all-purpose flour
5 teaspoons baking powder
5 teaspoons baking soda
5 tablespoons sugar
1 pinch salt (optional)

1. In a large bowl, whisk together the eggs, milk, butter and buttermilk. Combine the flour, baking powder, baking soda and sugar; stir into the wet ingredients just until blended. Adjust the thickness of the batter to your liking by adding more flour or buttermilk if necessary.
2. Heat a large skillet over medium heat, and coat with cooking spray. Pour 1/4 cupfuls of batter onto the skillet, and cook until bubbles appear on the surface. Flip with a spatula, and cook until browned on the other side. Continue with remaining batter.
(12 servings)
(Reply) (Parent) (Thread)
[User Picture]From: schpydurx
2009-11-16 11:37 am (UTC)
instead of pretending to work like someone else I could think of
Obama?
(Reply) (Parent) (Thread)
From: snapper521
2009-11-16 11:48 am (UTC)
Yeah he's one of the many people I could name who only pretend to work.

Speaking of which it's time for me to go. I'll come back and finish re-commenting you later.
(Reply) (Parent) (Thread)