Bash Shell Scripting

Almost anything goes -- politics of tech, humor, the internet.... Looks like we're gonna be here for a while....

Bash Shell Scripting

Postby cuttheredwire » 08/27/10, 6:50 am

As you may have notices, while that down and dirty guide was pretty simple and complete, it is very dirty. If anyone knows of a better source, I'll post it next week. I just found that one and thought it was a great thing to know, and handy if you use Cygwin. After reading through it and thinking about it, it was good but not great.

Sadly, the best guide I know is Unix in a Nutshell. It was the text book in a class I took years ago. You can probably find it in your local library, or through an inter-library loan. That's where I found my copy (you gotta love infinite renewals).
(• ShellCity's Second Banana •• Skinnables's Newsie •)
cuttheredwire
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
 
Posts: 37
Joined: 12/30/02, 12:00 am

Postby JohnT » 08/27/10, 8:46 pm

"A man may be a fool and not know it, but not if he is married."
JohnT
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
 
Posts: 2486
Joined: 12/03/01, 12:00 am
Location: Vladivostok, Russia

Postby RedRage » 11/10/10, 3:56 pm

man bash :D
RedRage
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
 
Posts: 1541
Joined: 12/04/01, 12:00 am

Postby Don_U » 11/18/10, 2:33 am

See how you are Red :D

So I could use Aspell and bash together?

Want to run a script that will:

cd var/www

aspell check

do not check html tags (an aspell cmd)

at this point prompt me for file name and extension to load

Is this possible?
I never look back, dahling, it distracts from the now -Edna Mode
Beware of men in white vans at the freeway off ramps selling discount America. It is defective,
contains lead, and is not made here.
Robotic Undertones
Don_U
Senior Member I Get Free Beer
Senior Member I Get Free Beer
 
Posts: 766
Joined: 08/03/09, 10:33 am
Location: Grand Rapids Mi.

Postby Gerry » 11/18/10, 1:19 pm

Don_U wrote:See how you are Red :D

So I could use Aspell and bash together?

Want to run a script that will:

cd var/www

aspell check

do not check html tags (an aspell cmd)

at this point prompt me for file name and extension to load

Is this possible?


I know it's not exactly what you have asked for, but I tried to guess what you might mean:

If you are in xwindows (on Ubuntu or just have Zenity installed) this should do the trick.

Code: Select all
#!/bin/bash

cd /var/www/
file=`zenity --file-selection`
aspell check --mode=sgml $file


If you only have a command line then you will need to replace Zenity with something a little more primitive. I would suggest the first command line argument. Which means replace $file with $1 and call the script like so:

webspell /var/www/randomfile.html
I answer rhetorical questions for my own enjoyment.
Gerry
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
 
Posts: 5727
Joined: 12/04/01, 12:00 am
Location: Perth, Western Australia

Postby Don_U » 11/19/10, 1:53 am

THX!
I never look back, dahling, it distracts from the now -Edna Mode
Beware of men in white vans at the freeway off ramps selling discount America. It is defective,
contains lead, and is not made here.
Robotic Undertones
Don_U
Senior Member I Get Free Beer
Senior Member I Get Free Beer
 
Posts: 766
Joined: 08/03/09, 10:33 am
Location: Grand Rapids Mi.


Return to Free Beer

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests

cron