Re: The best scripts ever (trick or treat)
On Wed, Nov 02, 2005 at 10:47:43PM +0200, Giorgos Keramidas wrote: > On 2005-11-02 12:42, Gary Kline <[EMAIL PROTECTED]> wrote: > > On Wed, Nov 02, 2005 at 10:14:40PM +0200, Giorgos Keramidas wrote: > > > > > > > > "CATEORY: foo > > > > "FUNCTION: it_does_this > > > > "OPTIONS: can_do_this_or_that" > > > > > > > > BEGINSCRIPT > > > > !#/bin/sh > > > > echo "hello world" > > > > ENDSCRIPT > > > > > > What happens when the script itself contains a line that starts > > > with one of the special "markup" lines? > > > > > > > AFAIK, the only markup lines this would use would be > > the . A sh script might use the ">" or "<" > > for redirection, but the conversion script would ignore > > everything between > > > > BEGINSCRIPT > > ENDSCRIPT > > > > which would make parsing straightforeward. > > Unless the shell script itself contains 'ENDSCRIPT' somewhere ;-) > > This is what I was referring to as "markup". Hmmm! :-) Okay, then what about BEGIN_somelonghexstringthatis256byteslong and END_somelonghexstringthatis256byteslong > -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Wed, Nov 02, 2005 at 10:14:40PM +0200, Giorgos Keramidas wrote: > > > > "CATEORY: foo > > "FUNCTION: it_does_this > > "OPTIONS: can_do_this_or_that" > > > > BEGINSCRIPT > > !#/bin/sh > > echo "hello world" > > ENDSCRIPT > > What happens when the script itself contains a line that starts > with one of the special "markup" lines? > AFAIK, the only markup lines this would use would be the . A sh script might use the ">" or "<" for redirection, but the conversion script would ignore everything between BEGINSCRIPT ENDSCRIPT which would make parsing straightforeward. gary -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Wed, Nov 02, 2005 at 09:39:07AM +, Ceri Davies wrote: > On Tue, Nov 01, 2005 at 02:20:51PM -0800, Gary Kline wrote: > > > Let's say we request people submit only their sh script > > (to start). What would the format need to be so that > > a script could parse email and auto-HTML the script?' > > #!/bin/sh -- > portinstall squirrelmail > > Did I win a biscuit? :) > > Ceri Would some gold stars do? :) evolution take ASCII and iso.8859-15 text and turns it into HTML too (I think; don't *quote me*). I have a C prog that I've been using privingly for 11 years that does this and more, but what what I'm thinkg of is a script that would take a posted script and using the KEYWORDS of, say: "CATEORY: foo "FUNCTION: it_does_this "OPTIONS: can_do_this_or_that" BEGINSCRIPT !#/bin/sh echo "hello world" ENDSCRIPT and generate am HTML file like: Function This script does: "it does this" Options This script "can do this or that" using flags "-a" "-b" "-c" !#/bin/sh echo "hello world" In most things I agree with the KISS philosophy: "Keep it simple, Sir". This is my off-the-top-of-my-head idea; I'm sure most of you guys are better at shell and-or HTML hacking and have better ideas. gary -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Nov 2, 2005, at 3:09 PM, Gary Kline wrote: On Wed, Nov 02, 2005 at 10:47:43PM +0200, Giorgos Keramidas wrote: On 2005-11-02 12:42, Gary Kline <[EMAIL PROTECTED]> wrote: On Wed, Nov 02, 2005 at 10:14:40PM +0200, Giorgos Keramidas wrote: "CATEORY: foo "FUNCTION: it_does_this "OPTIONS: can_do_this_or_that" BEGINSCRIPT !#/bin/sh echo "hello world" ENDSCRIPT What happens when the script itself contains a line that starts with one of the special "markup" lines? AFAIK, the only markup lines this would use would be the . A sh script might use the ">" or "<" for redirection, but the conversion script would ignore everything between BEGINSCRIPT ENDSCRIPT which would make parsing straightforeward. Unless the shell script itself contains 'ENDSCRIPT' somewhere ;-) This is what I was referring to as "markup". Hmmm! :-) Okay, then what about BEGIN_somelonghexstringthatis256byteslong and END_somelonghexstringthatis256byteslong Dammit!! I was just writing a script that used that exact variable! - Eric F Crist Secure Computing Networks http://www.secure-computing.net ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On 2005-11-02 13:09, Gary Kline <[EMAIL PROTECTED]> wrote: >On Wed, Nov 02, 2005 at 10:47:43PM +0200, Giorgos Keramidas wrote: >>On 2005-11-02 12:42, Gary Kline <[EMAIL PROTECTED]> wrote: >>>On Wed, Nov 02, 2005 at 10:14:40PM +0200, Giorgos Keramidas wrote: > BEGINSCRIPT > !#/bin/sh > echo "hello world" > ENDSCRIPT What happens when the script itself contains a line that starts with one of the special "markup" lines? >>> >>> AFAIK, the only markup lines this would use would be >>> the . A sh script might use the ">" or "<" >>> for redirection, but the conversion script would ignore >>> everything between >>> >>> BEGINSCRIPT >>> ENDSCRIPT >>> >>> which would make parsing straightforeward. >> >> Unless the shell script itself contains 'ENDSCRIPT' somewhere ;-) >> >> This is what I was referring to as "markup". > > Hmmm! :-) > > Okay, then what about > BEGIN_somelonghexstringthatis256byteslong > > and > > END_somelonghexstringthatis256byteslong That's an idea. A simple shar(1) archive could probably work too: flame:/home/keramida$ shar .forward # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # .forward # echo x - .forward sed 's/^X//' >.forward << 'END-of-.forward' X|/usr/local/bin/procmail END-of-.forward exit ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On 2005-11-02 12:42, Gary Kline <[EMAIL PROTECTED]> wrote: > On Wed, Nov 02, 2005 at 10:14:40PM +0200, Giorgos Keramidas wrote: > > > > > > "CATEORY: foo > > > "FUNCTION: it_does_this > > > "OPTIONS: can_do_this_or_that" > > > > > > BEGINSCRIPT > > > !#/bin/sh > > > echo "hello world" > > > ENDSCRIPT > > > > What happens when the script itself contains a line that starts > > with one of the special "markup" lines? > > > > AFAIK, the only markup lines this would use would be > the . A sh script might use the ">" or "<" > for redirection, but the conversion script would ignore > everything between > > BEGINSCRIPT > ENDSCRIPT > > which would make parsing straightforeward. Unless the shell script itself contains 'ENDSCRIPT' somewhere ;-) This is what I was referring to as "markup". ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On 2005-11-02 12:07, Gary Kline <[EMAIL PROTECTED]> wrote: > On Wed, Nov 02, 2005 at 09:39:07AM +, Ceri Davies wrote: > > On Tue, Nov 01, 2005 at 02:20:51PM -0800, Gary Kline wrote: > > > > > Let's say we request people submit only their sh script > > > (to start). What would the format need to be so that > > > a script could parse email and auto-HTML the script?' > > > > #!/bin/sh -- > > portinstall squirrelmail > > > > Did I win a biscuit? :) > > > > Ceri > > > Would some gold stars do? :) > > evolution take ASCII and iso.8859-15 text and turns it into > HTML too (I think; don't *quote me*). I have a C prog that > I've been using privingly for 11 years that does this and > more, but what what I'm thinkg of is a script that would > take a posted script and using the KEYWORDS of, say: > > "CATEORY: foo > "FUNCTION: it_does_this > "OPTIONS: can_do_this_or_that" > > BEGINSCRIPT > !#/bin/sh > echo "hello world" > ENDSCRIPT What happens when the script itself contains a line that starts with one of the special "markup" lines? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Tue, Nov 01, 2005 at 02:20:51PM -0800, Gary Kline wrote: > Let's say we request people submit only their sh script > (to start). What would the format need to be so that > a script could parse email and auto-HTML the script?' #!/bin/sh -- portinstall squirrelmail Did I win a biscuit? :) Ceri -- Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-- Einstein (attrib.) pgpYKXDxrzvmw.pgp Description: PGP signature
Re: The best scripts ever (trick or treat)
On 11/1/05, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: > On 2005-10-31 17:11, Gary Kline <[EMAIL PROTECTED]> wrote: > > On Mon, Oct 31, 2005 at 10:18:12PM +, dgmm wrote: > > > On Monday 31 October 2005 21:21, Fafa Hafiz Krantz wrote: > > > > POST YOUR COOLEST SCRIPTS! <3 (trick or treat) > > > > > > Unless it's FreeBSD specific scripts you are talking about would > > > news://comp.unix.shell not be better for this? > > > > Yeah, but reached netnews may be more trouble for lots of us. > > I say, "Come on down!" > > Nah! Too much traffic for little gain, I think. > > A web page with shell script collections and a link posted to the > list would be *much* more preferable, if you ask me. A web page > is easier to extend later on, reorganize, categorize, present in > multiple ways, etc. without increasing the traffic of the list > immensely. i couldnt agree more , and the best (plus usefull) ones could included in a package or in the examples directory ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Tue, Nov 01, 2005 at 03:12:56PM -0600, Eric F Crist wrote: > On Nov 1, 2005, at 12:59 PM, Gary Kline wrote: > > > > What's the best way of suggesting that we (fbsd.org) support a > >page of > > "best scripts"?? > > > > (Another beneficial project that would only require > > mailing in a function or n functions would be to submit > > functions that do a given task. A few lines of description > > and example use, of course.) > > > > gary > > > > PS: I've cc'd www with this. If anybody is interested, > > let's discuss it. --At least a collection of > > best /bin/sh scripts. > > > It's been too long since I contributed... I'd be willing to discuss > and perhaps help out in some manner with a project like this. > > > I think if you point at bsd.thought.org you'll find a stub; it was to have been for a BSD sysadmin book. Ran out of steam. Anyway, like everybody doing this kind of volunteer work, I've got negative time:-) But the space for some text-only scripts. Let's say we request people submit only their sh script (to start). What would the format need to be so that a script could parse email and auto-HTML the script?' I suggested a few headers [in all CAPS]; what else? gary -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Nov 1, 2005, at 12:59 PM, Gary Kline wrote: What's the best way of suggesting that we (fbsd.org) support a page of "best scripts"?? (Another beneficial project that would only require mailing in a function or n functions would be to submit functions that do a given task. A few lines of description and example use, of course.) gary PS: I've cc'd www with this. If anybody is interested, let's discuss it. --At least a collection of best /bin/sh scripts. It's been too long since I contributed... I'd be willing to discuss and perhaps help out in some manner with a project like this. - Eric F Crist Secure Computing Networks http://www.secure-computing.net ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Tue, Nov 01, 2005 at 07:56:19AM -0500, Fafa Hafiz Krantz wrote: > > kline at thought dot org thinks I'm spam. > > -- > Fafa Hafiz Krantz > Research Designer @ http://www.bleed.com > No. Sorry, it's just my /etc/mail/access file is buggy. It's got to be one of your relays. gary > -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Tue, Nov 01, 2005 at 02:14:14PM +0200, Giorgos Keramidas wrote: > On 2005-10-31 21:51, Gary Kline <[EMAIL PROTECTED]> wrote: > > On Tue, Nov 01, 2005 at 03:30:50AM +0200, Giorgos Keramidas wrote: > > > A web page with shell script collections and a link posted to the > > > list would be *much* more preferable, if you ask me. A web page > > > is easier to extend later on, reorganize, categorize, present in > > > multiple ways, etc. without increasing the traffic of the list > > > immensely. > > > > I'd be willing to host a scripts website here; I already > > have a slew of hits of my ThinkPad and CTWM pages. > > > > But the scripts would have to be drop-in-able. Otherwise, > > would freebsd.org be willing to donate a few pages? > > I'm not sure. Since this sounds good, it's not (IMHO) a bad idea > to bring it up in the freebsd-doc or freebsd-www lists, to see if > people have similar plans already or would support such a project. > What's the best way of suggesting that we (fbsd.org) support a page of "best scripts"?? (Another beneficial project that would only require mailing in a function or n functions would be to submit functions that do a given task. A few lines of description and example use, of course.) gary PS: I've cc'd www with this. If anybody is interested, let's discuss it. --At least a collection of best /bin/sh scripts. > -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
The best scripts ever (trick or treat)
kline at thought dot org thinks I'm spam. -- Fafa Hafiz Krantz Research Designer @ http://www.bleed.com -- ___ Play 100s of games for FREE! http://games.mail.com/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On 2005-10-31 21:51, Gary Kline <[EMAIL PROTECTED]> wrote: > On Tue, Nov 01, 2005 at 03:30:50AM +0200, Giorgos Keramidas wrote: > > A web page with shell script collections and a link posted to the > > list would be *much* more preferable, if you ask me. A web page > > is easier to extend later on, reorganize, categorize, present in > > multiple ways, etc. without increasing the traffic of the list > > immensely. > > I'd be willing to host a scripts website here; I already > have a slew of hits of my ThinkPad and CTWM pages. > > But the scripts would have to be drop-in-able. Otherwise, > would freebsd.org be willing to donate a few pages? I'm not sure. Since this sounds good, it's not (IMHO) a bad idea to bring it up in the freebsd-doc or freebsd-www lists, to see if people have similar plans already or would support such a project. - Giorgos ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
At Mon, 31 Oct 2005 it looks like Gary Kline composed: On Mon, Oct 31, 2005 at 08:13:31PM -0600, Kevin Kinsey wrote: Giorgos Keramidas wrote: On 2005-10-31 17:11, Gary Kline <[EMAIL PROTECTED]> wrote: Also sounds a tad like forum fodder. bsdforums.org is fairly well trafficked --- I daresay it'd do fairly well there, considering there's a "show us your desktop" thread that gets several posts a week for the past two years or so.. Sounds like something I'll check into. I'd think that a forum could be scoured and formatted into pages. Given a few scripts. Plus the *time*. Because I could never write them all that well I used to just browse thru these for some ideas... http://www.sun.com/bigadmin/scripts/ -- Bill Schoolcraft PO Box 210076 San Francisco, CA 94121 http://billschoolcraft.com ~ "You do best what you like most." ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Mon, Oct 31, 2005 at 08:13:31PM -0600, Kevin Kinsey wrote: > Giorgos Keramidas wrote: > > >On 2005-10-31 17:11, Gary Kline <[EMAIL PROTECTED]> wrote: > > > > > > Also sounds a tad like forum fodder. bsdforums.org is fairly > well trafficked --- I daresay it'd do fairly well there, considering > there's a "show us your desktop" thread that gets several posts > a week for the past two years or so.. > Sounds like something I'll check into. I'd think that a forum could be scoured and formatted into pages. Given a few scripts. Plus the *time*. gary PS: FWIW: I've got dozens of C functions that I use as templates to create short ( < 500 line ) programs. ---There used to be a publib suite of neat funcs -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Tue, Nov 01, 2005 at 03:30:50AM +0200, Giorgos Keramidas wrote: > On 2005-10-31 17:11, Gary Kline <[EMAIL PROTECTED]> wrote: > > On Mon, Oct 31, 2005 at 10:18:12PM +, dgmm wrote: > > > On Monday 31 October 2005 21:21, Fafa Hafiz Krantz wrote: > > > > POST YOUR COOLEST SCRIPTS! <3 (trick or treat) > > > > > > Unless it's FreeBSD specific scripts you are talking about would > > > news://comp.unix.shell not be better for this? > > > > Yeah, but reached netnews may be more trouble for lots of us. > > I say, "Come on down!" > > Nah! Too much traffic for little gain, I think. > > A web page with shell script collections and a link posted to the > list would be *much* more preferable, if you ask me. A web page > is easier to extend later on, reorganize, categorize, present in > multiple ways, etc. without increasing the traffic of the list > immensely. > I'd be willing to host a scripts website here; I already have a slew of hits of my ThinkPad and CTWM pages. But the scripts would have to be drop-in-able. Otherwise, would freebsd.org be willing to donate a few pages? gary -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
Giorgos Keramidas wrote: On 2005-10-31 17:11, Gary Kline <[EMAIL PROTECTED]> wrote: On Mon, Oct 31, 2005 at 10:18:12PM +, dgmm wrote: On Monday 31 October 2005 21:21, Fafa Hafiz Krantz wrote: POST YOUR COOLEST SCRIPTS! <3 (trick or treat) Unless it's FreeBSD specific scripts you are talking about would news://comp.unix.shell not be better for this? Yeah, but reached netnews may be more trouble for lots of us. I say, "Come on down!" Nah! Too much traffic for little gain, I think. A web page with shell script collections and a link posted to the list would be *much* more preferable, if you ask me. A web page is easier to extend later on, reorganize, categorize, present in multiple ways, etc. without increasing the traffic of the list immensely. Also sounds a tad like forum fodder. bsdforums.org is fairly well trafficked --- I daresay it'd do fairly well there, considering there's a "show us your desktop" thread that gets several posts a week for the past two years or so.. KDK ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On 2005-10-31 17:11, Gary Kline <[EMAIL PROTECTED]> wrote: > On Mon, Oct 31, 2005 at 10:18:12PM +, dgmm wrote: > > On Monday 31 October 2005 21:21, Fafa Hafiz Krantz wrote: > > > POST YOUR COOLEST SCRIPTS! <3 (trick or treat) > > > > Unless it's FreeBSD specific scripts you are talking about would > > news://comp.unix.shell not be better for this? > > Yeah, but reached netnews may be more trouble for lots of us. > I say, "Come on down!" Nah! Too much traffic for little gain, I think. A web page with shell script collections and a link posted to the list would be *much* more preferable, if you ask me. A web page is easier to extend later on, reorganize, categorize, present in multiple ways, etc. without increasing the traffic of the list immensely. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Mon, Oct 31, 2005 at 10:18:12PM +, dgmm wrote: > On Monday 31 October 2005 21:21, Fafa Hafiz Krantz wrote: > > POST YOUR COOLEST SCRIPTS! <3 (trick or treat) > > Unless it's FreeBSD specific scripts you are talking about would > news://comp.unix.shell not be better for this? Yeah, but reached netnews may be more trouble for lots of us. I say, "Come on down!" gary > > -- > Dave > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" -- Gary Kline [EMAIL PROTECTED] www.thought.org Public service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: The best scripts ever (trick or treat)
On Monday 31 October 2005 21:21, Fafa Hafiz Krantz wrote: > POST YOUR COOLEST SCRIPTS! <3 (trick or treat) Unless it's FreeBSD specific scripts you are talking about would news://comp.unix.shell not be better for this? -- Dave ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
The best scripts ever (trick or treat)
Hello. POST YOUR COOLEST SCRIPTS! <3 (trick or treat) I thought I'd create this thread for all you script enthusiasts out there. I've newly started basic shell programming, and just the very thought of it gives me this warm fuzzy feeling of having scripts assisting me in shaping things exactly the way I want them. I know you all gurus out there might be shaking your heads in despair to this, but I'm just trying to increase my passion and that of others further, if such a thing is at all possible. For whatever purpose you made your scripts, as long as you're proud of them and they're not classified as top secret, please be a sport on this glorious night of halloween and share them with us! Anyway, here are my humble contributions: crlf.sh: #!/bin/sh # # Removes CRLF line termination in ASCII files. # $URBAN: crlf.sh,v 1.0 2005/10/24 15:09:05 fafa Exp $ # for file in `find . -type f ! -name ".*"`; do if [ "`file -b "$file" | grep "text.*CRLF"`" != "" ]; then perl -i -pe 's,\r\n,\n,g' "$file" echo "$file: Done" fi done mode.sh: #!/bin/sh # # Sets default ownership and permissions. # $URBAN: mode.sh,v 1.0 2005/10/24 15:09:05 fafa Exp $ # chown -R johann:wheel * find . -type d -exec chmod 755 '{}' \; find . -type f -exec chmod 644 '{}' \; mp3.sh: #!/bin/sh # # Generate SFV and M3U for MP3 releases. # $URBAN: mp3.sh,v 1.0 2005/10/24 15:05:09 fafa Exp $ # for file in `find /mnt/out/mp3 -name \*.nfo`; do directory="`dirname ${file}`" prefix="`basename ${file} | sed 's/.nfo//g'`" current="`basename ${directory}`" sfv="${directory}/${prefix}.sfv" m3u="${directory}/${prefix}.m3u" cd ${directory} rm -f *.sfv > /dev/null 2>&1 rm -f *.m3u > /dev/null 2>&1 touch ${sfv} cfv -Cq *.mp3 cat ${current}.sfv | awk '! /^;/' > ${sfv} rm -f ${current}.sfv for mp3 in *.mp3; do echo "${mp3}" >> ${m3u}; done echo "$current: Done" done tws.sh: #!/bin/sh # # Removes trailing whitespaces in ASCII files. # $URBAN: tws.sh,v 1.0 2005/10/24 15:09:05 fafa Exp $ # for file in `find . -type f ! -name ".*"`; do if [ "`file -b "$file" | grep text`" != "" ]; then perl -i -pe 's/\s+$/\n/' "$file" echo "$file: Done" fi done tree.sh: #!/bin/sh # # TREE.SH 1.0 # # Reads a directory or file list, # then writes a tree. # # $URBAN: tree.sh,v 1.0 2005/10/24 15:05:09 fafa Exp $ # # -a, --all Prints all files, not just directories. # -h, --help Prints usage information. # -l, --list Reads a list of files from stdin. # -v, --version Print the version and exit. # # Karl Vogel <[EMAIL PROTECTED]> # Sumaria Systems, Inc. # PATH=/bin:/usr/sbin:/usr/bin:/usr/local/bin export PATH umask 022 tag=`basename $0` # *** Functions # # die: prints an optional argument to stderr and exits. # warn: prints an optional argument to stderr. # # A common use for "die" is with a test: # # test -f /etc/passwd || die "no passwd file" # # This works in subshells and loops, # but may not exit with a code other than 0. # die () { echo "$tag: Error: $*" 1>&2 exit 1 } # *** Usage # # Prints an optional string plus part of the comment header # (if any) to stderr, and exits with code 1. # usage () { lines=`egrep -n '^# (NAME|AUTHOR)' $0 | sed -e 's/:.*//'` ( case "$#" in 0) ;; *) echo "Usage error: $*"; echo ;; esac case "$lines" in "") ;; *) set `echo $lines | sed -e 's/ /,/'` sed -n ${1}p $0 | sed -e 's/^#//g' | egrep -v AUTHOR: ;; esac ) 1>&2 exit 1 } # *** Version # # Prints the current version to stdout. # version () { lsedscr='s/RCSfile: // s/.Date: // s/,v . .Revision: / v/ s/\$//g' lrevno='$RCSfile: tree.sh,v $ $Revision: 1.0 $' lrevdate='$Date: 2005/09/09 01:17:30 $' echo "$lrevno $lrevdate" | sed -e "$lsedscr" exit 0 } # *** mktree # # Sort the file information properly. # mktree () { scr=' s,^.$,, /^$/d s,[^/]*/\([^/]*\)$,+-\1, s,[^/]*/,| ,g' tr '/' '\001' | sort -f | tr '\001' '/' | sed -e "$scr" } # *** Main program defaults # ac_help= ac_prev= ac_invalid="Invalid option; use --help to show usage" argv= # *** Initialize some variables set by options. # all=no list=no fopt="-type d" for ac_option do # *** If the previous option needs an argument, assign it. # case "$ac_prev" in "") ;; *) eval "$ac_prev=\$ac_option"; ac_prev=; continue ;; esac case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *)ac_optarg= ;;