[newbie] bash-script to umount win partitions then kppp

2003-11-11 Thread Johan
Hi
What I would like to do is...with some script
Use kppp to connect internet BUT to  umount my windows partitions before 
activating kppp.
I usually forget to umount my win part. - I have read it is better to do 
this and protect win part against virusses.
With a script I can force the operation
At this moment I have this script#script name is dial
konsole
su -c umnt-win  #a existing script - works fine by itself
kppp
**
dial is now linked to my desktop
When activated.
konsole appear...fine...but now I have to type in  * su -c umnt-win *
and de-activate konsole..
now kppp appears.
**
I am sure there must be a way to let all this happen and me only to 
enter root password. (maybe I am just lazy or want learn more).
I would appreciate some input here
Thanks
-- 
Johan
May this be a good day for learning
Registered Linux User #330034 - still learning


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


RE: [newbie] bash-script to umount win partitions then kppp

2003-11-11 Thread Tony S. Sykes
Johan,

I could be wrong on this but I don't think leaving the Windows
partitions mounted would cause a problem. As you are using Linux and not
going to run any viruses through wine you should be okay. Don't save any
files to the windows partition before running a virus scan against them.

Tony.

-Original Message-
From: Johan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 10:28 AM
To: newbie
Subject: [newbie] bash-script to umount win partitions  then kppp


Hi
What I would like to do is...with some script
Use kppp to connect internet BUT to  umount my windows partitions before
activating kppp.
I usually forget to umount my win part. - I have read it is better to do
this and protect win part against virusses.
With a script I can force the operation
At this moment I have this script#script name is dial
konsole
su -c umnt-win  #a existing script - works fine by itself
kppp
**
dial is now linked to my desktop
When activated.
konsole appear...fine...but now I have to type in  * su -c umnt-win *
and de-activate konsole..
now kppp appears.
**
I am sure there must be a way to let all this happen and me only to 
enter root password. (maybe I am just lazy or want learn more).
I would appreciate some input here
Thanks
-- 
Johan
May this be a good day for learning
Registered Linux User #330034 - still learning
  

-+-+-+-+-+-+-+- Business Computer Projects - Disclaimer -+-+-+-+-+-+-+-

This message, and any associated attachment is confidential. If you have
received it in error, please delete it from your system, do not use or
disclose the information in any way, and notify either Tony S. Sykes
or the postmaster mailto:[EMAIL PROTECTED]  immediately.

The contents of this message may contain personal views which are not
necessarily the views of Business Computer Projects Ltd., unless
specifically stated.  

Whilst every effort has been made to ensure that emails and their
attachments are virus free, it is the responsibility of the recipient(s)
to verify the integrity of such emails.

 
Business Computer Projects Ltd
BCP House
151 Charles Street
Stockport
Cheshire
SK1 3JY
 
Tel: +44 (0)161 355-3000
Fax: +44 (0)161 355-3001
Web: http://www.bcpsoftware.com http://www.bcpsoftware.com/ 

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] bash-script to umount win partitions then kppp

2003-11-11 Thread Derek Jennings
On Tuesday 11 Nov 2003 10:28 am, Johan wrote:
 Hi
 What I would like to do is...with some script
 Use kppp to connect internet BUT to  umount my windows partitions before
 activating kppp.
 Thanks

Where did you read that? It is nonsense.
If you connecting with Linux you are not going to get any viruses anyway, and 
a Linux virus (If there were any in the wild) would not gravitate to Windows 
partitions. It could only do damage in the linux partitions.

But if it would make you more comfortable to unmount your windows partitions 
while on dial up, then use the scripts 
 /etc/ppp/if-up.local and  /etc/ppp/if-down

Kppp will automatically run the scripts in those files. You will probably have 
to create them, and do not forget to make them executable.

derek

-- 
--
www.jennings.homelinux.net
http://twiki.mdklinuxfaq.org


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-05 Thread bascule
okay josenildo,
if you don't have exif support in your camera then you might want to rename 
files based on their timestamp, i do this with my camera because it also 
creates avis and wavs, by renaming them before editing the 'modification' 
timestamp of the files is the time they were created, i copy them to a temp 
directory using 'cp -a' and then run the attached one-liner in that 
directory, if you only have files with the one suffix of course then you 
won't need the bit about storing the suffix in varaible!
i guess what i'm saying is look at the 'stat' and 'date' commands :)

bascule

On Friday 05 Sep 2003 1:49 pm, Anne Wilson wrote:
 On Friday 05 Sep 2003 3:16 am, Josenildo Marques wrote:
My camera is a quasi-camera. It must be an old model.
Don't bother, Todd. It's good enough as it is.
  
   That might be it, then. Still, I'd like to confirm that it
   doesn't use exif headers.
  
   Todd
 
  OK, it is a Pretec DC-520 USB camera. I use GTKam to grab the pics.
  GTKam has an option I have just seen, a box to check and save exif
  data. I checked it, saved more pics but they don't seem to be any
  different from all the others. All the pics are saved with the .JPG
  extension. That's it. As I said, it's OK.

 Don't know if it helps, but some setting in kde lets you see an
 enlarged thumbnail together with exif info when you hover over the
 image.  Example attached - note the exposure info.

 Anne

-- 
'Is it heroic to die like this?' said Conina.
'I think it is,' he said, 'and when it comes to dying, there's only one 
opinion that matters.'
(Sourcery)


photorename
Description: application/shellscript
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-04 Thread roland
 
   These are digital camera pix , the product of an event to which I would
   like to add a replacement prefix for dsci to reflect the nature of
   the
   event and a date, so in this case I might choose something lile
   bankholiday240803followed by 0001.jpg etc.
  
   Can someone suggest a script to do this for me so I don't have to
   manually retype the file name in properties for each file. It would be
   nice if I could run the script and it asked me for  a syntax , which
   would be different in each event , and then added it in place of the
   bit
   of syntax to be removed.
   I think it might be nice if I could just copy the bash script file to
   the source directory and run it from there, dunno though .
  

Here's a script modified from linux magazine dec 02/jan 03. Which will
rename files. 
---
#!/bin/sh
for photo in *jpg;
do
mv $photo `echo $photo | sed 's/dsci/bankholiday/'`

done
---
Run it in the directory where the files are. You can modify to take
arguments ($1 $2 etc). test it first ;-)

Roland




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-04 Thread Josenildo Marques
On Thu, 2003-09-04 at 09:37, Todd Slater wrote:
 On Thu, Sep 04, 2003 at 12:43:55AM -0300, Josenildo Marques wrote:
  On Thu, 2003-09-04 at 00:34, Todd Slater wrote:
   On Thu, Sep 04, 2003 at 12:13:05AM -0300, Josenildo Marques wrote:
On Wednesday 03 September 2003 19:40, Todd Slater wrote:
 On Wed, Sep 03, 2003 at 06:50:26PM -0300, Josenildo Marques wrote:
 
  I tried the rename script, but I can't get the date to appear, even using
  the - -d switch...
 
  TIA

 you're talking about the script I sent for John, or getpix? Do you have
 the exif package? (urpmi exif)

Yes, that one. I installed exif before running it.
   
   My guess is that your camera might not use exif headers, then? What
   happens if you do:
   
   exif -t DateTimeOriginal yourpicture.jpg
   
   That should give some output with the last line being a value of the
   date and time the picture was taken. Let's see what that gives.
   
   Todd
  
  Nothing happened. 
  Perhaps I wasn't clear in my answer. I was referring to the rename.sh
  script.
 
 Right, and rename.sh calls exif to determine the date (contained in the
 exif header) the picture was taken. Running exif alone would give you
 some output you could use to troubleshoot. If you try exif
 yourpicture.jpg you might get even more info.
 
  My camera is a quasi-camera. It must be an old model.
  Don't bother, Todd. It's good enough as it is.
 
 That might be it, then. Still, I'd like to confirm that it doesn't use
 exif headers.
 
 Todd

OK, it is a Pretec DC-520 USB camera. I use GTKam to grab the pics.
GTKam has an option I have just seen, a box to check and save exif data.
I checked it, saved more pics but they don't seem to be any different
from all the others. All the pics are saved with the .JPG extension.
That's it. As I said, it's OK.

Thank you very much!



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-04 Thread Josenildo Marques
On Thu, 2003-09-04 at 09:37, Todd Slater wrote:
 On Thu, Sep 04, 2003 at 12:43:55AM -0300, Josenildo Marques wrote:
  On Thu, 2003-09-04 at 00:34, Todd Slater wrote:
   On Thu, Sep 04, 2003 at 12:13:05AM -0300, Josenildo Marques wrote:
On Wednesday 03 September 2003 19:40, Todd Slater wrote:
 On Wed, Sep 03, 2003 at 06:50:26PM -0300, Josenildo Marques wrote:
 
  I tried the rename script, but I can't get the date to appear, even using
  the - -d switch...
 
  TIA

 you're talking about the script I sent for John, or getpix? Do you have
 the exif package? (urpmi exif)

Yes, that one. I installed exif before running it.
   
   My guess is that your camera might not use exif headers, then? What
   happens if you do:
   
   exif -t DateTimeOriginal yourpicture.jpg
   
   That should give some output with the last line being a value of the
   date and time the picture was taken. Let's see what that gives.
   
   Todd
  
  Nothing happened. 
  Perhaps I wasn't clear in my answer. I was referring to the rename.sh
  script.
 
 Right, and rename.sh calls exif to determine the date (contained in the
 exif header) the picture was taken. Running exif alone would give you
 some output you could use to troubleshoot. If you try exif
 yourpicture.jpg you might get even more info.
 
  My camera is a quasi-camera. It must be an old model.
  Don't bother, Todd. It's good enough as it is.
 
 That might be it, then. Still, I'd like to confirm that it doesn't use
 exif headers.
 
 Todd

Sorry. I forgot to mention one more thing. The file command shows the
following:

cyberhades: ~/$ file IMG_0001.JPG 
IMG_0001.JPG: JPEG image data, JFIF standard 1.01, aspect ratio, 1 x 1
 



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-03 Thread Josenildo Marques
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday 25 August 2003 15:35, Todd Slater wrote:
 On Mon, Aug 25, 2003 at 03:10:45PM +, John Richard Smith wrote:
  OK, so this is a tipical download via my smart card reader,
  [EMAIL PROTECTED] root]# cd /root/sane2
  [EMAIL PROTECTED] sane2]# ls
  dsci0001.jpg*  dsci0007.jpg*  dsci0013.jpg*  dsci0019.jpg*

 snip

  These are digital camera pix , the product of an event to which I would
  like to add a replacement prefix for dsci to reflect the nature of
  the
  event and a date, so in this case I might choose something lile
  bankholiday240803followed by 0001.jpg etc.
 
  Can someone suggest a script to do this for me so I don't have to
  manually retype the file name in properties for each file. It would be
  nice if I could run the script and it asked me for  a syntax , which
  would be different in each event , and then added it in place of the
  bit
  of syntax to be removed.
  I think it might be nice if I could just copy the bash script file to
  the source directory and run it from there, dunno though .
 
  Possible ?

 My getpix script will do this--you're welcome to take a look at it and
 see how I did the renaming scheme, which is basically called like
 getpix -n bankholiday which would give you bankholiday-001.jpg


I tried the rename script, but I can't get the date to appear, even using the 
- -d switch...

TIA

- -- 
cyb

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/VmIp4eVBtrgQWDsRAit/AKCYAvlebmjU7KcDqMVh3y9EqWgoyQCcCTRr
MAyg1Dv+CKvbPRrQKrXU/M0=
=88Gu
-END PGP SIGNATURE-


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-03 Thread Todd Slater
On Wed, Sep 03, 2003 at 06:50:26PM -0300, Josenildo Marques wrote:
  My getpix script will do this--you're welcome to take a look at it and
  see how I did the renaming scheme, which is basically called like
  getpix -n bankholiday which would give you bankholiday-001.jpg
 
 
 I tried the rename script, but I can't get the date to appear, even using the 
 - -d switch...
 
 TIA

you're talking about the script I sent for John, or getpix? Do you have
the exif package? (urpmi exif)

Todd

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-03 Thread Mark
On Wed, 3 Sep 2003, Josenildo Marques wrote:
 
 I tried the rename script, but I can't get the date to appear, even using the
 -d switch...
 
 TIA
 
 --
 cyb
 

Cyb,

I'm assuming you're working with a bash script and I've used bash for 
this, but I've found perl to be easier to work with. I've got a script 
already written that does something similar to what you're needing. It 
would take only a wee bit of modification to change it to do specifically 
what you want. I've attached it. Please feel free to modify it any way you 
wish. if you have any questions just holler. 

-- 
Mark

If necessity is the mother of invention, then who's the father?
---
Paid for by Penguins against modern appliances(R)
Linux User Since 1996
Powered by Mandrake Linux 8.2  9.1
ICQ# 27816299#!/usr/bin/perl

# Read in the data from the form

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@appdata = split(//, $buffer);

# Do a little quick decoding of all the form data so we can use it

foreach $appdata (@appdata) {
($name, $value) = split(/=/, $appdata);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg;
$FORM{$name} = $value;
}

#print Including the trailing \('/') slash \n;
#print place the directory path here: ;
$path = /home/mdw1982/mas_bookpics/;

exec(`ls --width=1 $path  dir.txt`);
open(FILE,dir.txt);
@a = FILE;
close(FILE);

foreach $item(@a){
chomp($item);
if($item =~ /^0/  $item != /([A-Za-z])/){
print \n;
#print $item\n;
$var = $item;
  #$I = $item;
@I = split(/-+/,$item);
$result = join(,  , @I);
print $result\n;#$I =~ s/([A-Z])/lc($1)/eog;
$arg1 = $path$var;
$arg2 = $path$result;
exec(`mv -f $arg1 $arg2`);
}
  }

print everything has been read and reported\n\n;



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-03 Thread Josenildo Marques
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wednesday 03 September 2003 20:23, Mark wrote:
 On Wed, 3 Sep 2003, Josenildo Marques wrote:
  I tried the rename script, but I can't get the date to appear, even using
  the -d switch...
 
  TIA
 
  --
  cyb

 Cyb,

 I'm assuming you're working with a bash script and I've used bash for
 this, but I've found perl to be easier to work with. I've got a script
 already written that does something similar to what you're needing. It
 would take only a wee bit of modification to change it to do specifically
 what you want. I've attached it. Please feel free to modify it any way you
 wish. if you have any questions just holler.


Thank you very much for this. I'll check it out.

- -- 
cyb

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/Vq0y4eVBtrgQWDsRAqg4AKCRQLVZXd4VLkR30UuI8aNup4BNUwCgmi8C
+G2Do9kbfL+m4sbInmeVgJI=
=cngI
-END PGP SIGNATURE-


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-03 Thread Josenildo Marques
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wednesday 03 September 2003 19:40, Todd Slater wrote:
 On Wed, Sep 03, 2003 at 06:50:26PM -0300, Josenildo Marques wrote:
   My getpix script will do this--you're welcome to take a look at it and
   see how I did the renaming scheme, which is basically called like
   getpix -n bankholiday which would give you bankholiday-001.jpg
 
  I tried the rename script, but I can't get the date to appear, even using
  the - -d switch...
 
  TIA

 you're talking about the script I sent for John, or getpix? Do you have
 the exif package? (urpmi exif)

 Todd

Yes, that one. I installed exif before running it.


- -- 
cyb

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/Vq3B4eVBtrgQWDsRAhBBAKCh/JsqBCbwfeDfEnvB9wdb8zEi5ACcCPl+
p6ImmW/8omKB60aJJaOuV0g=
=2/KH
-END PGP SIGNATURE-


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-03 Thread Todd Slater
On Thu, Sep 04, 2003 at 12:13:05AM -0300, Josenildo Marques wrote:
 On Wednesday 03 September 2003 19:40, Todd Slater wrote:
  On Wed, Sep 03, 2003 at 06:50:26PM -0300, Josenildo Marques wrote:
  
   I tried the rename script, but I can't get the date to appear, even using
   the - -d switch...
  
   TIA
 
  you're talking about the script I sent for John, or getpix? Do you have
  the exif package? (urpmi exif)
 
 Yes, that one. I installed exif before running it.

My guess is that your camera might not use exif headers, then? What
happens if you do:

exif -t DateTimeOriginal yourpicture.jpg

That should give some output with the last line being a value of the
date and time the picture was taken. Let's see what that gives.

Todd

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-09-03 Thread Josenildo Marques
On Thu, 2003-09-04 at 00:34, Todd Slater wrote:
 On Thu, Sep 04, 2003 at 12:13:05AM -0300, Josenildo Marques wrote:
  On Wednesday 03 September 2003 19:40, Todd Slater wrote:
   On Wed, Sep 03, 2003 at 06:50:26PM -0300, Josenildo Marques wrote:
   
I tried the rename script, but I can't get the date to appear, even using
the - -d switch...
   
TIA
  
   you're talking about the script I sent for John, or getpix? Do you have
   the exif package? (urpmi exif)
  
  Yes, that one. I installed exif before running it.
 
 My guess is that your camera might not use exif headers, then? What
 happens if you do:
 
 exif -t DateTimeOriginal yourpicture.jpg
 
 That should give some output with the last line being a value of the
 date and time the picture was taken. Let's see what that gives.
 
 Todd

Nothing happened. 
Perhaps I wasn't clear in my answer. I was referring to the rename.sh
script.
My camera is a quasi-camera. It must be an old model.
Don't bother, Todd. It's good enough as it is.




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


[newbie] Bash Script to change file prefix

2003-08-25 Thread John Richard Smith
OK, so this is a tipical download via my smart card reader,
[EMAIL PROTECTED] root]# cd /root/sane2
[EMAIL PROTECTED] sane2]# ls
dsci0001.jpg*  dsci0007.jpg*  dsci0013.jpg*  dsci0019.jpg* 
dsci0025.jpg*
dsci0002.jpg*  dsci0008.jpg*  dsci0014.jpg*  dsci0020.jpg* 
dsci0026.jpg*
dsci0003.jpg*  dsci0009.jpg*  dsci0015.jpg*  dsci0021.jpg* 
dsci0027.jpg*
dsci0004.jpg*  dsci0010.jpg*  dsci0016.jpg*  dsci0022.jpg* 
dsci0028.jpg*
dsci0005.jpg*  dsci0011.jpg*  dsci0017.jpg*  dsci0023.jpg*
dsci0006.jpg*  dsci0012.jpg*  dsci0018.jpg*  dsci0024.jpg*

These are digital camera pix , the product of an event to which I would
like to add a replacement prefix for dsci to reflect the nature of 
the
event and a date, so in this case I might choose something lile
bankholiday240803followed by 0001.jpg etc.

Can someone suggest a script to do this for me so I don't have to
manually retype the file name in properties for each file. It would be
nice if I could run the script and it asked me for  a syntax , which
would be different in each event , and then added it in place of the 
bit
of syntax to be removed.
I think it might be nice if I could just copy the bash script file to
the source directory and run it from there, dunno though .

Possible ?

Also out of pure curiosity why does the file names all end in  *  ?

John



--
John Richard Smith
[EMAIL PROTECTED]




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-08-25 Thread Kaj Haulrich
On Monday 25 August 2003 03:10 pm, John Richard Smith wrote:
 OK, so this is a tipical download via my smart card reader,
 [EMAIL PROTECTED] root]# cd /root/sane2
 [EMAIL PROTECTED] sane2]# ls
 dsci0001.jpg*  dsci0007.jpg*  dsci0013.jpg*  dsci0019.jpg*
 dsci0025.jpg*
 dsci0002.jpg*  dsci0008.jpg*  dsci0014.jpg*  dsci0020.jpg*
 dsci0026.jpg*
 dsci0003.jpg*  dsci0009.jpg*  dsci0015.jpg*  dsci0021.jpg*
 dsci0027.jpg*
 dsci0004.jpg*  dsci0010.jpg*  dsci0016.jpg*  dsci0022.jpg*
 dsci0028.jpg*
 dsci0005.jpg*  dsci0011.jpg*  dsci0017.jpg*  dsci0023.jpg*
 dsci0006.jpg*  dsci0012.jpg*  dsci0018.jpg*  dsci0024.jpg*

 These are digital camera pix , the product of an event to
 which I would like to add a replacement prefix for dsci to
 reflect the nature of the
 event and a date, so in this case I might choose something
 lile bankholiday240803followed by 0001.jpg etc.

 Can someone suggest a script to do this for me so I don't have
 to manually retype the file name in properties for each file.
 It would be nice if I could run the script and it asked me for
  a syntax , which would be different in each event , and then
 added it in place of the bit
 of syntax to be removed.
 I think it might be nice if I could just copy the bash script
 file to the source directory and run it from there, dunno
 though .

 Possible ?

 Also out of pure curiosity why does the file names all end in
  *  ?

 John

Not sure what you want John, but I think *rename* will do the 
job. It's a little awkward IMHO, but try *man rename*. At least 
I had some succes with the same problem.

HTH
Kaj Haulrich
-- 
Registered Linux user  # 214073 at http://counter.li.org
Powered by Linux - Mandrake 9.1  kernel 2.4.21-0.25mdk
Sent to you from a 100 % Micro$oft-free computer. 

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-08-25 Thread Todd Slater
On Mon, Aug 25, 2003 at 03:10:45PM +, John Richard Smith wrote:
 OK, so this is a tipical download via my smart card reader,
 [EMAIL PROTECTED] root]# cd /root/sane2
 [EMAIL PROTECTED] sane2]# ls
 dsci0001.jpg*  dsci0007.jpg*  dsci0013.jpg*  dsci0019.jpg* 
snip 
 These are digital camera pix , the product of an event to which I would
 like to add a replacement prefix for dsci to reflect the nature of 
 the
 event and a date, so in this case I might choose something lile
 bankholiday240803followed by 0001.jpg etc.
 
 Can someone suggest a script to do this for me so I don't have to
 manually retype the file name in properties for each file. It would be
 nice if I could run the script and it asked me for  a syntax , which
 would be different in each event , and then added it in place of the 
 bit
 of syntax to be removed.
 I think it might be nice if I could just copy the bash script file to
 the source directory and run it from there, dunno though .
 
 Possible ?

My getpix script will do this--you're welcome to take a look at it and
see how I did the renaming scheme, which is basically called like
getpix -n bankholiday which would give you bankholiday-001.jpg

http://clevername.homeip.net/scripts/

Assuming you're mounting your smartcard reader, you can use the entire
script as-is, just change the variables to suit your needs.

 Also out of pure curiosity why does the file names all end in  *  ?

I believe it means they are executable.

Todd

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Bash Script to change file prefix

2003-08-25 Thread Paul
On Mon, 2003-08-25 at 20:35, Todd Slater wrote:
  Also out of pure curiosity why does the file names all end in  *  ?
 
 I believe it means they are executable.

You believe correctly.

-- 
To himself everyone is immortal; 
he may know that he is going to die, 
but he can never know that he is dead. 
- Samuel Butler 

http://www.nlpagan.net - Linux Mandrake - Ximian Evolution


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


[newbie] bash script to send files to tar from rox-filer

2003-07-20 Thread Eric Huff
I program quite a bit in other languages, but am somewhat new to bash,
so this may not be the most elegant program, but i'm having fun learning
it!

Anyway, i put this in ~/Choices/SendTo  as tar_rox

In rox-filer, if you select several files or dirs and Send To tar_rox,
it'll tar them up in the same directory w/o the entire path to the
files/dirs.  (any structure w/i the dir will be preserved).

I have to go outside (ah!) now, but i'll add prompting for filename as a
learn a bit more.  Then probaly a pipe for sylpheed...

The if chunk's purpose is to strip the filenames off the arguments,
since they come in with full paths, and to
find the path of the files (since pwd is ~/).

Thought this might be of interest to some, and any bash(ing) comments
are welcome!

eric

-
#!/bin/bash
#xmessage $@

FILEPATH=`pwd`   #will be reset to files' path if needed

echo $@ | grep -q /

if [ $? = 0 ] ; then
FILENAMES=''
for item in $@; do
let count=0

if [[ `echo $item | cut -c1` = '/' ]] ; then
let count=1
fi

VAR='1'
while [[ $VAR != '' ]]; do
  let count=count+1
  VAR=`echo $item | cut -d/ -f$count`
done

FILEPATH=`echo $item | cut -d/ -f1-$((count-2))`
FILENAMES=$FILENAMES` echo  ``echo $item | cut -d/ -f$((count-1))`
done
else
FILENAMES=$@
fi

echo $FILEPATH
cd $FILEPATH

#xmessage `tar -cvf tmp.tar $FILENAMES`
tar -cvf tmp.tar $FILENAMES

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] bash script to send files to tar from rox-filer

2003-07-20 Thread JoeHill
On Sun, 20 Jul 2003 11:59:19 -0700
Eric Huff [EMAIL PROTECTED] uttered:

 In rox-filer, if you select several files or dirs and Send To
 tar_rox, it'll tar them up in the same directory w/o the entire path
 to the files/dirs.  (any structure w/i the dir will be preserved).

Ok. I am more than new to bash scritpting, but won't ROX archive do
this?

-- 
Joehill
Registered Linux user #282046
++
Even the best of friends cannot attend each other's funeral.
-- Kehlog Albran, The Profit

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] bash script to send files to tar from rox-filer

2003-07-20 Thread Eric Huff
  In rox-filer, if you select several files or dirs and Send To
  tar_rox, it'll tar them up in the same directory w/o the entire path
  to the files/dirs.  (any structure w/i the dir will be preserved).
 
 Ok. I am more than new to bash scritpting, but won't ROX archive do
 this?

Probably.  I didn't get it to work when i installed it, and then got
distracted, so never went back to figure it out. Some sort of pygtk or
python library trouble.  I'll get back to it eventually...

I mostly used this as an excuse to learn a little more about bash.
Still trying to figure out when you need [ and when you need [[ ...

eric

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] bash script to send files to tar from rox-filer

2003-07-20 Thread Todd Slater
On Sun, 20 Jul 2003 11:59:19 -0700
Eric Huff [EMAIL PROTECTED] wrote:

 
 The if chunk's purpose is to strip the filenames off the arguments,
 since they come in with full paths, and to
 find the path of the files (since pwd is ~/).

I don't know if `basename` will help you with that or not.

Todd

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] bash script to send files to tar from rox-filer

2003-07-20 Thread Eric Huff
 I don't know if `basename` will help you with that or not.

 Yes!

That's way better.  That's the area where i will have to learn the most:
what functions are out there.  It's fun to learn the hard way, too,
though...

Thanks for the command,
eric


Here's the basename version:


#!/bin/bash

FILEPATH=`pwd`   #will be reset to files' path if needed
echo $@ | grep -q /

if [ $? = 0 ] ; then

# get filenames
FILENAMES=''
for item in $@; do
FILENAMES=$FILENAMES `basename $item`
done

#get path
FILEPATH=$(echo $1 | sed s/`basename $1`//)

else
FILENAMES=$@
fi

echo $FILEPATH
cd $FILEPATH

tar -cvf tmp.tar $FILENAMES

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] bash script to enter su password?

2002-04-07 Thread Lee

On Sunday 07 April 2002 12:24 am, s wrote:
 On Saturday 06 April 2002 10:58 pm, Jon Doe wrote:
  I am looking to make a script that can be run as a normal user in su mode
  with out having to enter su password. Basically I want to be able to
  mount my usb digital camera without having to log in as root. Any
  suggestions?

 sudo?

Try this first.  As root, edit fstabs and change default to user.  That's 
what worked finally for me.  Then I created an icon on the desktop to mount 
the camera and all is well.

Lee
-- 
Registered Linux abuser #223705




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



[newbie] bash script to enter su password?

2002-04-06 Thread Jon Doe

I am looking to make a script that can be run as a normal user in su mode with out 
having to enter su password.
Basically I want to be able to mount my usb digital camera without having to log in as 
root. Any suggestions?



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] bash script to enter su password?

2002-04-06 Thread Paul

On Sat, 6 Apr 2002 23:58:51 -0500 Jon wrote:

I am looking to make a script that can be run as a normal user in su mode
with out having to enter su password. Basically I want to be able to mount
my usb digital camera without having to log in as root. Any suggestions?

It would be much easier to add your login name to the group that is assigned
to the digital-camera group...

Paul

--
A closed mouth gathers no feet.

http://nlpagan.net - Registered Linux User 174403
Linux Mandrake 8.2 - Sylpheed 0.7.4



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] bash script to enter su password?

2002-04-06 Thread s

On Saturday 06 April 2002 10:58 pm, Jon Doe wrote:
 I am looking to make a script that can be run as a normal user in su mode
 with out having to enter su password. Basically I want to be able to mount
 my usb digital camera without having to log in as root. Any suggestions?

sudo?



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] bash script

2001-12-03 Thread Anuerin G.Diaz
On 03 Dec 2001 16:47:11 -0500
Paul Rodr$ByH(Buez [EMAIL PROTECTED] wrote:

 Ok 
 
 Lets say I have files in Dir2 which I have symlinks for in Dir1.  
 So the contents of Dir1 include links to all the files in Dir2, plus
 files of its own...
 
 I want to delete all of those symlinks in Dir1 for Dir2, without
 deleting anything else, or going through them one by one...
 
 Is there a way I can say something like..
   rm -rf /Dir1/(output of ls Dir2)
 
 Or, said another way...
 
   rm -rf /Dir1/(all symlinks to contents of Dir2)
 
 
 Thanks!
 
 -Paul Rodr$Bmg(Buez
 
 


hi paul,

  im working on the assumption that all links on Dir1 refer to the files in Dir2 and 
is to be deleted without harming the files in Dir2...


  #!/bin/bash

  for file_d1 in `ls`
  do
if [ -L $file_d1 ] #test for a link
then
  rm $file_d1
fi
  done



  if my assumption is wrong then pls reply and ill do what i can to assist.

ciao!
  

-- 

"Programming, an artform that fights back."

===

Anuerin G. Diaz
Design Engineer
25/F Equitable-PCI Tower
ADB Ave. cor. Poveda St.,
Ortigas Center, Pasig City,
Philippines 1605

Tel no: (632) 6383070 loc 75
===

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] bash script

2001-12-03 Thread Paul Rodríguez

With some [read LOTS] of help on IRC, I found way to do this:

find dir1/ -lname /dir2 | xargs rm

this find all files in dir1 which link to dir2 (it's important to know
whether you want to find files that link relatively or absolutely), then
pipes this info to xargs and rm.  Try it just up to the pipe to see how
it lists the links.  

For mroe info, check out man find and man xargs

-Paul Rodríguez

On Mon, 2001-12-03 at 16:47, Paul Rodríguez wrote:
 Ok 
 
 Lets say I have files in Dir2 which I have symlinks for in Dir1.  
 So the contents of Dir1 include links to all the files in Dir2, plus
 files of its own...
 
 I want to delete all of those symlinks in Dir1 for Dir2, without
 deleting anything else, or going through them one by one...
 
 Is there a way I can say something like..
   rm -rf /Dir1/(output of ls Dir2)
 
 Or, said another way...
 
   rm -rf /Dir1/(all symlinks to contents of Dir2)
 
 
 Thanks!
 
 -Paul Rodríguez
 
 
 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com
 
 
 
 =_1007416123-31033-1102
 Want to buy your Pack or Services from MandrakeSoft? 
 Go to http://www.mandrakestore.com



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] bash script to remove ?

2001-06-06 Thread n6tadam

Hi,

This can be done, using the following:

1. assuming that your local mailbox is in /var/spool/mail/$username, then
do the following:

snip

#!/bin/bash
regex=
mailbox=/var/spool/mail/$username

#list contents
cat $mailbox | grep $regex | sed -e /$regex//g;  /var/spool/mail/newmail

snip

2. replace all instances of $username mentioned above with the actual
filename of your inbox. If the inbox you will be searching is not your own,
then this script will have to be ran as the root user.

3. Save the above script in /usr/bin folder, using a suitable name, and
issue the following command:

chmod 700 /usr/bin/filename

4. Then run the script. The resultant output will appear in the file
/var/spool/mail/newmail

HTH,

Thomas Adam
Linux Co-ordinator for the Purbeck School (Network Support)

- Original Message -
From: Jon Doe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 06, 2001 4:55 AM
Subject: [newbie] bash script to remove ?


 I know it has to be pretty simple but I can't figure it out. How can I
right
 a bash script to remove the  from forwarded emails?




Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk





[newbie] bash script to remove ?

2001-06-05 Thread Jon Doe

I know it has to be pretty simple but I can't figure it out. How can I right 
a bash script to remove the  from forwarded emails?




Re: [newbie] bash script to remove ?

2001-06-05 Thread Paul

It was Tue, 5 Jun 2001 23:55:02 -0400 when Jon Doe wrote:

I know it has to be pretty simple but I can't figure it out. How can I right 
a bash script to remove the  from forwarded emails?

You have to have the e-mail in a separate file (like the MH mail structure).
Then you can test the first character of a line and use the 'cut' command to
take it off if it is a 

See man bash for info on how to determine the first character of a line...

Paul

--
Avoiding danger is no safer in the long run than outright 
exposure.  The fearful are caught as often as the bold.
-Helen Keller

http://nlpagan.net -  Registered Linux User 174403
   Linux Mandrake 7.2 - Sylpheed 0.4.66
** http://www.care2.com - when you care **