Re: [OT] SSH login script - Help

2009-04-29 Thread Steven W. Orr
On Saturday, Apr 25th 2009 at 21:55 -, quoth Bill Davidsen: =Is there a benefit from not just using a login key (in authorized keys) to =eliminate the need for passwords and also have the security of a single =command which could be executed using the key? = =I do my backups that way, just

Re: [OT] SSH login script - Help

2009-04-29 Thread Tim
On Wed, 2009-04-29 at 23:20 -0400, Steven W. Orr wrote: Bill, I would have to say that the answer is yes. Besides the fact that logging in via a passwordless system is more convenient, it's also more secure; you're username and password is never in the clear. It's not, anyway, with a SSH

Re: [OT] SSH login script - Help

2009-04-26 Thread Mikkel L. Ellertson
Bill Davidsen wrote: Dan Track wrote: Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done I have a small scripting knowledge so would appreciate some help. What I'd like to do is somehow change the above so that the script prompts me for a

Re: [OT] SSH login script - Help

2009-04-26 Thread Jonathan Underwood
2009/4/26 Mikkel L. Ellertson mik...@infinity-ltd.com: It depends on what you are trying to do. If it is a task that you do often, then it is worth while. But for tasks like this, that you do infrequently, it is handy to have a key pair with a good pass phrase. You use ssh-agent and ssh-add to

Re: [OT] SSH login script - Help

2009-04-25 Thread Bill Davidsen
Dan Track wrote: Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done I have a small scripting knowledge so would appreciate some help. What I'd like to do is somehow change the above so that the script prompts me for a password and when I give

[OT] SSH login script - Help

2009-04-24 Thread Dan Track
Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done I have a small scripting knowledge so would appreciate some help. What I'd like to do is somehow change the above so that the script prompts me for a password and when I give the script the

Re: [OT] SSH login script - Help

2009-04-24 Thread Sharpe, Sam J
Dan Track wrote: 2009/4/24 Manuel Aróstegui man...@todo-linux.com: On Fri, 2009-04-24 at 10:12 +0100, Dan Track wrote: Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done I have a small scripting knowledge so would appreciate some help.

Re: [OT] SSH login script - Help

2009-04-24 Thread Manuel Aróstegui
On Fri, 2009-04-24 at 11:16 +0100, Sharpe, Sam J wrote: Dan Track wrote: 2009/4/24 Manuel Aróstegui man...@todo-linux.com: On Fri, 2009-04-24 at 10:12 +0100, Dan Track wrote: Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done

Re: [OT] SSH login script - Help

2009-04-24 Thread Joachim Backes
Manuel Aróstegui wrote: On Fri, 2009-04-24 at 10:12 +0100, Dan Track wrote: Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done I have a small scripting knowledge so would appreciate some help. What I'd like to do is somehow change the above so

Re: [OT] SSH login script - Help

2009-04-24 Thread Manuel Aróstegui
On Fri, 2009-04-24 at 10:12 +0100, Dan Track wrote: Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done I have a small scripting knowledge so would appreciate some help. What I'd like to do is somehow change the above so that the script

Re: [OT] SSH login script - Help

2009-04-24 Thread Mikkel L. Ellertson
Dan Track wrote: Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done I have a small scripting knowledge so would appreciate some help. What I'd like to do is somehow change the above so that the script prompts me for a password and when I

Re: [OT] SSH login script - Help

2009-04-24 Thread Patrick O'Callaghan
On 04/24/2009 04:42 AM, Dan Track wrote: Hi Guys, I've written a simple for loop see below: for i in orion earth;do scp /etc/hosts /etc;done Have you noticed that your loop body (do ...; done) contains no reference to the loop variable $i? poc -- fedora-list mailing list

Re: script help

2008-12-03 Thread Bill Davidsen
Dave Ihnat wrote: On Mon, Dec 01, 2008 at 04:22:16PM -0500, Bill Davidsen wrote: That won't work if filenames contain blanks, something I fight daily. For blanks, do something like find . -name *log -exec rm -fr {} \; I have a tiny program called zeroify which reads a line from input up to a

Re: script help

2008-12-03 Thread Patrick O'Callaghan
On Wed, 2008-12-03 at 09:10 -0500, Bill Davidsen wrote: I have a tiny program called zeroify which reads a line from input up to a newline, replaced the newline with a zero byte, and pushes it out stdout. Then I can use the -0 option of xargs and not worry about special characters. You

script help

2008-12-01 Thread adrian kok
Hi I have script to remove files but it can't work in directory ls *log | sort -r | sed -e 1,1d | xargs rm -f those folders are: Nov28-log Nov29-log Nov30-log Send instant messages to your online friends http://uk.messenger.yahoo.com -- fedora-list mailing list fedora-list@redhat.com To

Re: script help

2008-12-01 Thread James Kosin
adrian kok wrote: Hi I have script to remove files but it can't work in directory ls *log | sort -r | sed -e 1,1d | xargs rm -f those folders are: Nov28-log Nov29-log Nov30-log Send instant messages to your online friends http://uk.messenger.yahoo.com You have to change the

Re: script help

2008-12-01 Thread adrian kok
I did try it and it doesn't work! Thank you --- James Kosin [EMAIL PROTECTED] wrote: adrian kok wrote: Hi I have script to remove files but it can't work in directory ls *log | sort -r | sed -e 1,1d | xargs rm -f those folders are: Nov28-log Nov29-log Nov30-log

Re: script help

2008-12-01 Thread Les Mikesell
adrian kok wrote: Hi I have script to remove files but it can't work in directory ls *log | sort -r | sed -e 1,1d | xargs rm -f those folders are: Nov28-log Nov29-log Nov30-log By 'folders', do you mean that these are directories? You need to 'rm -rf' directories to remove the with

Re: script help

2008-12-01 Thread Bill Davidsen
adrian kok wrote: Hi I have script to remove files but it can't work in directory ls *log | sort -r | sed -e 1,1d | xargs rm -f those folders are: Nov28-log Nov29-log Nov30-log What is it you are trying to do here? Are you trying to remove files in the directory leaving the directory

Re: script help

2008-12-01 Thread Patrick O'Callaghan
On Tue, 2008-12-02 at 04:42 +0800, adrian kok wrote: Hi I have script to remove files but it can't work in directory ls *log | sort -r | sed -e 1,1d | xargs rm -f those folders are: Nov28-log Nov29-log Nov30-log You need to explain what you're trying to do exactly. Also, what's

Re: script help

2008-12-01 Thread Dave Ihnat
On Mon, Dec 01, 2008 at 04:10:50PM -0500, RGH wrote: The problem is that you're getting things like Nov28-log: back, with the trailing colon. Try this: ls -1d *log | xargs rm -Rf Note that the first option is a one, not an el. Or for that matter, just echo *log instead of ls. --

Re: script help

2008-12-01 Thread Dave Ihnat
On Mon, Dec 01, 2008 at 04:22:16PM -0500, Bill Davidsen wrote: That won't work if filenames contain blanks, something I fight daily. For blanks, do something like find . -name *log -exec rm -fr {} \; Of course, that's assuming the name pattern is what you want. You can also specify if you want

Re: script help

2008-12-01 Thread Gordon Messmer
Dave Ihnat wrote: On Mon, Dec 01, 2008 at 04:10:50PM -0500, RGH wrote: ls -1d *log | xargs rm -Rf Note that the first option is a one, not an el. Or for that matter, just echo *log instead of ls. Neither of those are reliable. If there are enough matches to require xargs, then both ls

Re: script help

2008-12-01 Thread RGH
Dave Ihnat wrote: On Mon, Dec 01, 2008 at 04:22:16PM -0500, Bill Davidsen wrote: That won't work if filenames contain blanks, something I fight daily. For blanks, do something like find . -name *log -exec rm -fr {} \; Of course, that's assuming the name pattern is what you want. You

Re: script help

2008-12-01 Thread RGH
Gordon Messmer wrote: Dave Ihnat wrote: On Mon, Dec 01, 2008 at 04:10:50PM -0500, RGH wrote: ls -1d *log | xargs rm -Rf Note that the first option is a one, not an el. Or for that matter, just echo *log instead of ls. Neither of those are reliable. If there are enough matches to

Re: script help

2008-12-01 Thread Nifty Fedora Mitch
On Mon, Dec 01, 2008 at 08:35:15PM -0500, RGH wrote: Gordon Messmer wrote: Dave Ihnat wrote: On Mon, Dec 01, 2008 at 04:10:50PM -0500, RGH wrote: ls -1d *log | xargs rm -Rf Note that the first option is a one, not an el. Or for that matter, just echo *log instead of ls. Neither of

Re: Script help

2008-09-22 Thread Nifty Fedora Mitch
On Sat, Sep 20, 2008 at 10:36:13AM +1000, Cameron Simpson wrote: On 19Sep2008 15:51, NiftyFedora Mitch [EMAIL PROTECTED] wrote: | On Fri, Sep 19, 2008 at 3:43 PM, Cameron Simpson [EMAIL PROTECTED] wrote: | On 19Sep2008 14:08, Dennis Kaptain [EMAIL PROTECTED] wrote: | | Can anyone rattle

Re: Script help

2008-09-22 Thread James Pifer
Point... just that the OP never stated that the files were in exactly one dir and that duplicate file names were or were not possible. Yes close timestamps are also an issue (see stat). Hi. OP here. Files are all in the same dir. Duplicates obviously not an issue. Everything is working.

Script help

2008-09-19 Thread James Pifer
I've been googling to find ways of doing this but I'm not finding what I'm looking for. I think this should be fairly easy, so I'm hoping a script guru out there can tell me what I need. I have some files that are all named like: myfile387465893495643658734.txt myfile547647453645635632454.txt

Re: Script help

2008-09-19 Thread Mike Wright
James Pifer wrote: I've been googling to find ways of doing this but I'm not finding what I'm looking for. I think this should be fairly easy, so I'm hoping a script guru out there can tell me what I need. I have some files that are all named like: myfile387465893495643658734.txt

Re: Script help

2008-09-19 Thread Dennis Kaptain
Can anyone rattle this off of the top of their head? `ls -t myfile*.txt | head -1` might work for you. ls -t by itself may give you more than one filename per line. Use ls -t1 that will assure you get only one file name output from head. Dennis K

Re: Script help

2008-09-19 Thread Dennis Kaptain
I've been googling to find ways of doing this but I'm not finding what I'm looking for. I think this should be fairly easy, so I'm hoping a script guru out there can tell me what I need. I have some files that are all named like: myfile387465893495643658734.txt

Re: Script help

2008-09-19 Thread James Pifer
On Fri, 2008-09-19 at 13:50 -0700, Mike Wright wrote: James Pifer wrote: I've been googling to find ways of doing this but I'm not finding what I'm looking for. I think this should be fairly easy, so I'm hoping a script guru out there can tell me what I need. I have some files that

Re: Script help

2008-09-19 Thread James Pifer
On Fri, 2008-09-19 at 14:08 -0700, Dennis Kaptain wrote: Can anyone rattle this off of the top of their head? `ls -t myfile*.txt | head -1` might work for you. ls -t by itself may give you more than one filename per line. Use ls -t1 that will assure you get only one file

Re: Script help

2008-09-19 Thread Chris Tyler
On Fri, 2008-09-19 at 14:08 -0700, Dennis Kaptain wrote: Can anyone rattle this off of the top of their head? `ls -t myfile*.txt | head -1` might work for you. ls -t by itself may give you more than one filename per line. Use ls -t1 that will assure you get only one file

Re: Script help

2008-09-19 Thread Dennis Kaptain
ls -t by itself may give you more than one filename per line. Use ls -t1 that will assure you get only one file name output from head. Single-column output is automatically selected any time that the output of ls is redirected to anything which is not a tty, so the -1 option is not

Re: Script help

2008-09-19 Thread Aldo Foot
On Fri, Sep 19, 2008 at 2:18 PM, James Pifer [EMAIL PROTECTED] wrote: On Fri, 2008-09-19 at 13:50 -0700, Mike Wright wrote: James Pifer wrote: I've been googling to find ways of doing this but I'm not finding what I'm looking for. I think this should be fairly easy, so I'm hoping a script

Re: Script help

2008-09-19 Thread Cameron Simpson
On 19Sep2008 14:08, Dennis Kaptain [EMAIL PROTECTED] wrote: | Can anyone rattle this off of the top of their head? | | `ls -t myfile*.txt | head -1` might work for you. | | ls -t by itself may give you more than one filename per line. | Use ls -t1 | that will assure you get only one file

Re: Script help

2008-09-19 Thread NiftyFedora Mitch
On Fri, Sep 19, 2008 at 3:43 PM, Cameron Simpson [EMAIL PROTECTED] wrote: On 19Sep2008 14:08, Dennis Kaptain [EMAIL PROTECTED] wrote: | Can anyone rattle this off of the top of their head? | | `ls -t myfile*.txt | head -1` might work for you. | | ls -t by itself may give you more than

Re: Script help

2008-09-19 Thread Cameron Simpson
On 19Sep2008 15:51, NiftyFedora Mitch [EMAIL PROTECTED] wrote: | On Fri, Sep 19, 2008 at 3:43 PM, Cameron Simpson [EMAIL PROTECTED] wrote: | On 19Sep2008 14:08, Dennis Kaptain [EMAIL PROTECTED] wrote: | | Can anyone rattle this off of the top of their head? | | `ls -t myfile*.txt | head -1`

Re: Script help

2008-09-19 Thread Cameron Simpson
On 20Sep2008 10:36, I wrote: | Something like the find incantation of another post is the easy way: | | find . -type f -name 'myfile\*.txt' | ls -t | sed 1q Gah. My brain is off. Something more like this: files=`find . -type f -name 'myfile\*.txt'` ls -t -- $files | sed 1q Won't work if