Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 11 Nov 1996.
Re: REQ: .sig changer for UNIX

Re: REQ: .sig changer for UNIX

Stefan Alexei Lasiewski (gan...@rahul.net) wrote:
: Hi All!

: I'm looking for hints on how to make a .sig changer script for UNIX. I'm
: working in C and Korn shells, so a script working under either shell can
: work. Basicly, I'd like the script to change my script every time I log in
: (Or even better, randomly change every time I post an article/email a
: message). I haven't found any FAQ's on this...

: I know this sounds like a job for PERL, and I actually do have the
: 'sigrandom' PERL program, but I know very little of the language (But I'm
: learning), and cannot figure out how to get it to work on my system.

: So, does anyone have any hints suggestions on making a script. Here's the
: only version I can get to work... any hints or suggegstions would be
: appreciated.

: cp $HOME/.sig/sig8 $HOME/.signature
: cp $HOME/.sig/sig7 $HOME/.sig/sig8
: cp $HOME/.sig/sig6 $HOME/.sig/sig7
: cp $HOME/.sig/sig5 $HOME/.sig/sig6
: cp $HOME/.sig/sig4 $HOME/.sig/sig5
: cp $HOME/.sig/sig3 $HOME/.sig/sig4
: cp $HOME/.sig/sig2 $HOME/.sig/sig3
: cp $HOME/.sig/sig1 $HOME/.sig/sig2
: cp $HOME/.signature $HOME/.sig/sig1

: Rudementary, but it works. Basically... I have 8 files named sig1-sig8 in
: a directory named .sig. I want a different file to be copied as
: $HOME/.signature every time I log in.

Sounds to me like you've seen one of my posts somewhere about...

------- Begin included C-shell script ---------

#!/bin/csh

set dir = `pwd`
cd

if ( $#argv > 1 ) then
 echo "Usage: `basename $0` [number]"
 exit 1
endif

@ k = (10000)

set names = ( `ls .sigs` )
@ max = $#names

if ( $#argv == 0 ) goto done

set k = ($1)

loop:

 set q = `echo "$k[$#k]" | tr -d "[0-9]"`

 if ( "`expr '$q' : '.*'`" == "0" ) goto done

 ls .sigs | cat -n
 echo -n "Choose> "

 set k = ( `echo $<` )
 
 if ( $k[1] == 'v' ) then

   @ k2 = $k[$#k]
   if ( $k2 > $max ) then
    @ k2 = $max
   endif

   cat .sigs/$names[$k2]
   set k = ( dummy dummy )

 endif

goto loop

done:

if ( $k <= $max ) then

 @ ran = $k

else

 @ ran = `ksh 'echo $RANDOM'`
 @ ran = ( $ran % $max + 1 )

endif

\rm .sig
cp ./.sigs/$names[$ran] .sig
cd $dir

----- End included C-shell script -----

: -- 
: |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
: | Stefan Lasiewski                      >>>CONTENTS UNDER PRESSURE<<<	|
: | gan...@rahul.net                         >>>DO NOT PUNCTURE<<<	|
: | http://www.rahul.net/gangrel          	 			|

Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f996b,fe142cf911d2683e
X-Google-Attributes: gidf996b,public
From: crw...@comp.brad.ac.uk (Cyrek)
Subject: Re: REQ: .sig changer for UNIX
Date: 1996/11/11
Message-ID: <567h0e$bc...@columbia.acc.brad.ac.uk>#1/1
X-Deja-AN: 196193459
distribution: world
references: <560rm3$o9...@bug.rahul.net>
organization: University of Bradford
newsgroups: alt.ascii-art
About this message. This message was posted publicly to the newsgroup alt.ascii-art in 1996 and is mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you the author? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post