Re: Scripting questions

2003-09-24 Thread Brenden T.
Abdussamad Abdurrazzaq wrote: Hello Please help me with these basic scripting questions. How do you tell the path of the current directory? Is there an equivalent to the Left$ & Right$ functions found in BASIC in Linux scripting? What I mean is how do you extract a given number of characters f

Re: Scripting questions

2003-09-24 Thread Nurullah Akkaya
correct me if i am wrong so you want to know where you are on the system rigth ? so u can use pwd command that will tell the exact place where you are.. -- Nurullah Akkaya [EMAIL PROTECTED] Registered Linux User #301438 What lies behind us and what lies before us are tiny matters compared to w

Re: Scripting questions

2003-09-24 Thread Sean Estabrooks
On Wed, 24 Sep 2003 17:18:36 + Abdussamad Abdurrazzaq <[EMAIL PROTECTED]> wrote: > Hello > > Please help me with these basic scripting questions. How do you tell the > path of the current directory? Assuming you mean Bash scripting # echo $PWD > Is there an equivalent to the Left$ & R

Re: Scripting questions

2003-09-24 Thread Volker Kroll
On Wed, 2003-09-24 at 19:18, Abdussamad Abdurrazzaq wrote: > Please help me with these basic scripting questions. In which language, do you plan to program? > How do you tell the path > of the current directory? in the bash it is pwd [EMAIL PROTECTED]:~> pwd /home/kroll > Is there an equiva

Re: Scripting password

2003-09-05 Thread Cameron Simpson
On 23:39 03 Sep 2003, Patrick Nelson <[EMAIL PROTECTED]> wrote: | Writing a script that asks for a pass-phrase to use specific features of | the script. Would like to hid the input of the phrase from the screen | while the user types it in. Whats the best way? Well, the easy way is this:

Re: Scripting password

2003-09-04 Thread Jason Riedel
Patrick, I assume you are talking about Shell Script and for that, I don't know. But if bychance you're doing this in Perl, the perl module that you will utilize is Term::Readkey. http://www.perldoc.com/perl5.6/lib/Term/ReadKey.html Jason Riedel - Original Message - From: "Patrick

Re: scripting for file transfers from Linux to windows

2003-08-28 Thread Marcos de Souza Trazzini
On Wed, 2003-08-27 at 18:23, Peramslist wrote: > Hi, > I'm writing a script for transferring files by ftp from RH linix 9 to > Windows. > After I login to ftp box I need to cd to d:\target folder and from the > default dir. > I tried > ftp> cd d:/target > ftp> cd D:/target > > and > ftp> cd d:

Re: scripting help with ftp

2003-08-27 Thread Ronald W. Heiby
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 C-Kermit (for Linux) and Kermit-95 (for your Windows box) have tremendous scripting capabilities. There is a modest cost for the Kermit-95 distribution, but I have found it to be well worth it. Check it out at . Ron.

Re: scripting help with ftp

2003-08-26 Thread rick henderson
On Tue, 2003-08-26 at 00:13, Peram's List wrote: > Hi Gurus, > I need help with a script to transfer files from a linux box running RH > 8.0 from a windows 2000 box.The sequence is as follows: > 1. Ftp into the windows server, check for the existance of map* files in > ftp dir, if yes move the fil

Re: scripting help with ftp

2003-08-26 Thread Gerry Doris
On Tue, 26 Aug 2003, Peram's List wrote: > Hi Gurus, > I need help with a script to transfer files from a linux box running RH > 8.0 from a windows 2000 box.The sequence is as follows: > 1. Ftp into the windows server, check for the existance of map* files in > ftp dir, if yes move the files to t

Re: Scripting help

2003-08-22 Thread Cameron Simpson
I wrote: | > start=`perl -e 'print time'` | > body of script here ... | > end=`perl -e 'print time'` | > echo "took `expr $end - $start` seconds" Whoops - left off the quote around "print time" in the second perl. On 18:18 21 Aug 2003, Bret Hughes <[EMAIL PROTECTED]> wrote: |

RE: Scripting help

2003-08-21 Thread Jason Dixon
On Thu, 2003-08-21 at 20:24, Cowles, Steve wrote: > Jason Dixon wrote: > > On Thu, 2003-08-21 at 17:38, Peram's List wrote: > >> I appreciate your quick response. > >> Is there any way I get the time taken for the execution of a script > >> from the script itself instead of typing it at the command

RE: Scripting help

2003-08-21 Thread Cowles, Steve
Jason Dixon wrote: > On Thu, 2003-08-21 at 17:38, Peram's List wrote: >> I appreciate your quick response. >> Is there any way I get the time taken for the execution of a script >> from the script itself instead of typing it at the command line. > > To be honest, I can't get GNU time to even honor

Re: Scripting help

2003-08-21 Thread Jason Dixon
On Thu, 2003-08-21 at 17:38, Peram's List wrote: > I appreciate your quick response. > Is there any way I get the time taken for the execution of a script from > the script itself instead of typing it at the command line. To be honest, I can't get GNU time to even honor its own flags. It's also n

Re: Scripting help

2003-08-21 Thread Bret Hughes
On Thu, 2003-08-21 at 17:46, Cameron Simpson wrote: > On 16:38 21 Aug 2003, Peram's List <[EMAIL PROTECTED]> wrote: > | I appreciate your quick response. > | Is there any way I get the time taken for the execution of a script from > | the script itself instead of typing it at the command line. > >

Re: Scripting help

2003-08-21 Thread Cameron Simpson
On 16:38 21 Aug 2003, Peram's List <[EMAIL PROTECTED]> wrote: | I appreciate your quick response. | Is there any way I get the time taken for the execution of a script from | the script itself instead of typing it at the command line. Well, if you're still inside the script then the won't be "the

Re: Scripting help

2003-08-21 Thread Peram's List
IL PROTECTED]> Sent: Thursday, August 21, 2003 3:41 PM Subject: Re: Scripting help > On Thu, 2003-08-21 at 16:40, Peram's List wrote: > > Hi, > > I know this is a basic question but I tried on the web and could not > > find an answer. > > I'd appreciate if

Re: Scripting help

2003-08-21 Thread Jason Dixon
On Thu, 2003-08-21 at 16:40, Peram's List wrote: > Hi, > I know this is a basic question but I tried on the web and could not > find an answer. > I'd appreciate if you can guide me on how I can find the time taken for > a script to complete on Redhat 8.0. time Example: $ time sleep 3 real0

Re: Scripting help

2003-03-29 Thread Edward Dekkers
> The Linux Documentation Project has pretty good stuff: > > Advanced Bash-Scripting Guide > http://www.tldp.org/LDP/abs/html/ > > Tony Thanks Tony. Regards, --- Edward Dekkers (Director) Triple D Computer Services P/L -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] ht

Re: Scripting help

2003-03-29 Thread Edward Dekkers
> And there are loads of online tutorials on shell scripting. Google turned up > one such > tutorial for me: > > http://www.freeos.com/guides/lsst/ > > There must be others too. > > -- > Anand Thanks Anand - the stuff you just told me should in fact get me by. When I get more time on my hands (th

Re: Scripting help

2003-03-29 Thread Anthony E. Greene
On 29-Mar-2003/18:14 +0800, Edward Dekkers <[EMAIL PROTECTED]> wrote: >The commands, I have no problem with at all, but I'd like to build some >'smarts' into the sequence. > [snip] > >Anyone know of a good tutorial on the web to help me learn these few >things? The Linux Documentation Project has

Re: Scripting help

2003-03-29 Thread Anand Buddhdev
[cut] > But things like checking for zip return error codes, mounting the share > error codes etc. is new to me. Obviously if the share is unable to be > mounted, I'd like to skip the rest of the steps and echo "Backup PC could > not be mounted - error code >> backuplog.txt". And then drop > out.

Re: scripting an ssh session

2003-02-21 Thread Ivan Roseland
Dave Vehrs wrote: Use the Expect scripting langauge. It was designed for scripting interactive processes. Learn more at: http://expect.nist.gov/ Dave V. you could do it with NET::SSH::PERL ( Perl Modules) here is that part that matters. my $ssh = Net::SSH::Perl->new($host, options => [ "u

Re: scripting an ssh session

2003-02-21 Thread Dave Vehrs
Use the Expect scripting langauge. It was designed for scripting interactive processes. Learn more at: http://expect.nist.gov/ Dave V. On Tue, 2003-02-11 at 17:28, David Simmons wrote: > We have a couple of servers that we want to push out periodic updates > to. We want to automate this as muc

Re: scripting an ssh session

2003-02-15 Thread Rodolfo J. Paiz
On Tue, 2003-02-11 at 18:28, David Simmons wrote: > We have a couple of servers that we want to push out periodic updates > to. We want to automate this as much as possible. > > We have password-less ssh working (thanks to the group for that!). So > using a shell script we can login in to a re

Re: Scripting help

2003-02-13 Thread Darryl Harvey
And the one I like and use is; http://www.amazon.com/exec/obidos/ASIN/0130147117/qid=1045182968/sr=2-1/ref=sr_2_1/103-8867147-8196623 It's a winner Darryl At 04:17 PM 13/02/2003 -0800, you wrote: hi arden, gordon, et al, i tried out several shell books (including o'reilly), but the one i

Re: Scripting help

2003-02-13 Thread Jeff Stern
hi arden, gordon, et al, i tried out several shell books (including o'reilly), but the one i kept and keep using is below. chock full of examples (for bash) and task-oriented -- i.e., "how to do x" (and an example).. "how to do y" (and another example) etc etc. in fact, i have to keep stealing

Re: Scripting help

2003-02-13 Thread Jeff Bearer
You can sign up for O'reilly's safari for free for 15 days, they have the bash book on there, I've been using it and it's a great guide. On Wed, 2003-02-12 at 17:09, Todd A. Jacobs wrote: > On Wed, 12 Feb 2003, Arden Norder wrote: > > > Can anyone help me with a book title for Unix/Linux Scriptin

Re: Scripting help

2003-02-13 Thread Jan
Jon Haugsand wrote: You can, in our situation do something like: while read a b c d; do case "$a" in root) export R="ok" ;; daemon) export D="ok" ;; esac done < /etc/passwd And your "side effects" remain. (But I buy the point of portable scripting anyway.) Ah, y

Re: Scripting help

2003-02-13 Thread Jon Haugsand
* [EMAIL PROTECTED] > > NAME=`IFS=':' > > cat /etc/passwd | while read a b c d; do > > if [[ "$a" == "root" ]]; then > > echo $c > > fi > > done` > > > That's a good tip - thank you! However, that only works if we're > talking about 1 env variable. In my work it was actually a number

Re: Scripting help

2003-02-13 Thread Jan
Jon Haugsand wrote: * [EMAIL PROTECTED] IFS=':' cat /etc/passwd | while read a b c d do if [[ "$a" == "root" ]] then export NAME="$c" fi done - in ksh this will export NAME into your current env, but not in bash. The explanation, I understand, is that when you start a pipeline in

Re: Scripting help

2003-02-13 Thread Jon Haugsand
* [EMAIL PROTECTED] > > IFS=':' > cat /etc/passwd | while read a b c d > do > if [[ "$a" == "root" ]] > then >export NAME="$c" > fi > done > > - in ksh this will export NAME into your current env, but not in > bash. The explanation, I understand, is that when you start a pipel

Re: Scripting help

2003-02-13 Thread Jan
James Francis wrote: Arden Norder wrote: Hey folks!! Can anyone help me with a book title for Unix/Linux Scripting?? I used to (back in the DOS days) do alot of batch scripting using variables etc, etc, etc. I would like to try to automate some processes on my RH7.2 Server via unix batch scrip

Re: Scripting help

2003-02-12 Thread Gordon Ewasiuk
On Wed, 12 Feb 2003, Arden Norder wrote: > Hey folks!! > Can anyone help me with a book title for Unix/Linux Scripting?? > > I used to (back in the DOS days) do alot of batch scripting using variables etc, >etc, etc. > > I would like to try to automate some processes on my RH7.2 Server via unix

RE: scripting an ssh session

2003-02-12 Thread David Simmons
:09 PM To: [EMAIL PROTECTED] Subject: Re: scripting an ssh session On Tue, 2003-02-11 at 17:28, David Simmons wrote: > We have a couple of servers that we want to push out periodic updates > to. We want to automate this as much as possible. > > We have password-less ssh working (t

Re: scripting an ssh session

2003-02-12 Thread Bill Anderson
On Tue, 2003-02-11 at 17:28, David Simmons wrote: > We have a couple of servers that we want to push out periodic updates > to. We want to automate this as much as possible. > > We have password-less ssh working (thanks to the group for that!). So > using a shell script we can login in to a re

Re: Scripting help

2003-02-12 Thread Andrew Robinson
With a little web-searching, you should be able to find a ton of tutorials on shell scripting. If you liked DOS scripting, you'll be amazed at what you can do with one of the *nix shells. At 01:56 PM 2/12/2003 -0800, you wrote: O'Reilly makes a good book about Bash, see their site. /B - Or

Re: Scripting help

2003-02-12 Thread Anthony E. Greene
Arden Norder wrote: Can anyone help me with a book title for Unix/Linux Scripting?? I used to (back in the DOS days) do alot of batch scripting using variables etc, etc, etc. I would like to try to automate some processes on my RH7.2 Server via unix batch scripting. Also see the Advanced Bash

Re: Scripting help

2003-02-12 Thread Todd A. Jacobs
On Wed, 12 Feb 2003, Arden Norder wrote: > Can anyone help me with a book title for Unix/Linux Scripting?? The O'Reilly bash book is probably the best book for learning Linux shell scripting. While you can certainly use other shells or scripting languages, bash is the default shell on nearly all

Re: Scripting help

2003-02-12 Thread David Busby
O'Reilly makes a good book about Bash, see their site. /B - Original Message - From: "Arden Norder" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 12, 2003 13:51 Subject: Scripting help > Hey folks!! > Can anyone help me with a book title for Unix/Linux Scripting??

RE: Scripting help

2003-02-12 Thread James Francis
Arden Norder wrote: > Hey folks!! > Can anyone help me with a book title for Unix/Linux Scripting?? > > I used to (back in the DOS days) do alot of batch scripting > using variables etc, etc, etc. > > I would like to try to automate some processes on my RH7.2 > Server via unix batch scripting. >

Re: Scripting help

2003-02-12 Thread jkinz
On Wed, Feb 12, 2003 at 10:51:03PM +0100, Arden Norder wrote: > Hey folks!! > Can anyone help me with a book title for Unix/Linux Scripting?? > > I used to (back in the DOS days) do alot of batch scripting using variables etc, >etc, etc. > > I would like to try to automate some processes on my

Re: scripting an ssh session

2003-02-12 Thread Kevin
Here is an expect script that will ssh automatically.  It can be called by anything.  You can simply create the required send/expect in the script.  You can also automate the creation of the expect with autoexpect. [root@localhost root]# more autossh #!/usr/bin/expect spawn ssh -l -F

Re: scripting an ssh session

2003-02-12 Thread David Busby
Try using rsync, it might do what you need, will work over SSH or RSH. /B - Original Message - From: "David Simmons" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 16:28 Subject: scripting an ssh session > We have a couple of servers that we want to push

Re: scripting an ssh session

2003-02-11 Thread Todd A. Jacobs
On Tue, 11 Feb 2003, David Simmons wrote: > Is it possible to continue feeding commands from the ssh shell script I > wrote to the remote machine? For example, if my script is something > like: Interactive processes can be scripted using expect. But why not just place your remote commands in a

Re: scripting an ssh session

2003-02-11 Thread Dave Young
or, you could just: ssh [EMAIL PROTECTED] cd /usr/local; echo "some new command" >> therefile ;-) On Tuesday 11 February 2003 04:53 pm, Raymundo M. Vega wrote: > yes, i think you should do it like: -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https:

Re: scripting an ssh session

2003-02-11 Thread Raymundo M. Vega
yes, i think you should do it like: ssh [EMAIL PROTECTED] << EOF cd /usr/local echo "some new command" >> therefile logout exit 1 EOF hope it helps raymundo David Simmons wrote: We have a couple of servers that we want to push out periodic updates to. We want to automate this as much as possi

RE: scripting newbie has question...

2003-01-01 Thread Eric Ladner
ECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 30, 2002 4:54 PM > To: Stone, Timothy > Subject: Re: scripting newbie has question... > > > Tim, > > Will this help? > > Regards, Mike Klinke > > > --- > #!/bin/sh > # >

RE: scripting newbie has question...

2002-12-31 Thread Stone, Timothy
Mike and all, Worked like a charm! Thanks! Wishing you a happy new year! Tim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, December 30, 2002 4:54 PM To: Stone, Timothy Subject: Re: scripting newbie has question... Tim, Will this help? Regards

Re: scripting newbie has question...

2002-12-30 Thread David Busby
Timothy, You can set variables in your script to store the date information, like this (sort of) YR="2003" MO="1" Now your filename becomes "serverlog${MO}${YR}" in your script, You can put the result of commands into variables in your script like YR=`date` (those backticks make the shell se

Re: Scripting question

2002-12-04 Thread Thierry ITTY
>> >From a script: main.sh, I need to: >> 1. Copy file ./x to /tmp/x >> 2. Read a variable from stdin, for example: read VALUE >> 3. Search through file /tmp/x for the keyword REPLACE, and replace it with ${VALUE} >> >> I can't seem to figure out what combination of sed, perl, whatever I can use.

RE: Scripting question

2002-12-04 Thread Niessen, Klif
Just replace the single quotes with double quotes. Single quotes are keeping the $vars from being evaluated. sed "s/REPLACE/${VALUE}/g" /tmp/x > /tmp/x.new Klif -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinf

Re: Scripting question

2002-12-04 Thread Johnathan Bailes
On Tue, 2002-12-03 at 15:54, Shaw, Marco wrote: > >From a script: main.sh, I need to: > 1. Copy file ./x to /tmp/x > 2. Read a variable from stdin, for example: read VALUE > 3. Search through file /tmp/x for the keyword REPLACE, and replace it with ${VALUE} > > I can't seem to figure out what comb

Re: Scripting question

2002-12-03 Thread Bret Hughes
On Tue, 2002-12-03 at 14:54, Shaw, Marco wrote: > >From a script: main.sh, I need to: > 1. Copy file ./x to /tmp/x > 2. Read a variable from stdin, for example: read VALUE > 3. Search through file /tmp/x for the keyword REPLACE, and replace it with ${VALUE} > > I can't seem to figure out what comb

Re: Scripting

2002-11-05 Thread RH
status. Thanks. - Original Message - From: "Anthony E. Greene" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, November 05, 2002 3:21 AM Subject: Re: Scripting > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 05-Nov-2002/02:37 -

Re: Scripting

2002-11-05 Thread Anthony E. Greene
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05-Nov-2002/02:37 -0500, RH <[EMAIL PROTECTED]> wrote: >Hello >In my t1.txt log file I have such lines > >T1 1/1 is up. >Applique type is Channelized T1 >Cablelength is short 133 >No alarms detected. > >Now if it is possible with a shell script I w

Re: Scripting question on a "case" construct (THANKS!)

2002-07-19 Thread Joe Nestlerode
Thanks to both of you for responding. The empty quotes works best for what I wanted to do (which I should have been clearer on in the first place). I wanted to make the first choice in a menu the "default", ie, just hit , and the empty quotes allow me to do that: echo -e " Your selection, pl

Re: Scripting question on a "case" construct

2002-07-18 Thread Cameron Simpson
On 14:05 18 Jul 2002, Joe Nestlerode <[EMAIL PROTECTED]> wrote: | Can you put a carriage return (enter) as one of the choices in a 'case' | construct? *) will catch it, but I need that for the "Invalid Choice" | catch-all at the end. I couldn't find it in the documentation; is this | possible

Re: Scripting question on a "case" construct

2002-07-18 Thread Stephen Spalding
Now that I think about it, you asked for how to check for a response of just cr-lf. Here's what I should have sent you: #!/bin/bash echo "Please answer yes or no: " read answer if [ x"$answer" = x"" ]; then echo echo "*** Invalid Response! ***" echo exit -1 fi

Re: Scripting question on a "case" construct

2002-07-18 Thread Stephen Spalding
I think what I would do is put a check in for an empty response before the case statement is ever reached. Here's an example of what I mean: #!/bin/bash echo "Please answer yes or no: " read answer if [[ x"$answer" != x"yes" && x"$answer" != x"no" ]]; then echo echo "*** Invalid

Re: Scripting question - script to find and delete files

2002-07-12 Thread Saul Arias
On Fri, 2002-07-12 at 15:56, Joe Nestlerode wrote: > Thank you, that works beautifully. I modified it slightly to allow a > user to enter a search pattern on the command line, to wit: > > #!/bin/sh > > echo -e "Enter a file or pattern to search for...\n" > read file > > for i in `find . -name

Re: Scripting question - script to find and delete files

2002-07-12 Thread Joe Nestlerode
Saul, Thank you, that works beautifully. I modified it slightly to allow a user to enter a search pattern on the command line, to wit: #!/bin/sh echo -e "Enter a file or pattern to search for...\n" read file for i in `find . -name "$file"` do rm -i $i done exit 0 Thanks again! Joe [EMA

Re: Scripting question - script to find and delete files

2002-07-12 Thread Saul Arias
On Fri, 2002-07-12 at 13:13, Joe Nestlerode wrote: > I'm trying to write a simple script to search a directory tree for a > file pattern (specified as an argument with a wildcard, ie, testfile* or > *.jpg), and then delete matching files after first prompting the user > for a y/n. (yes=delete,

Re: scripting

2002-06-06 Thread Karl O . Pinc
On 2002.06.06 02:11 Jesse Angell wrote: > Okay, > There is a file lets call it user.conf > on line 23 of the file there is a line that says > user=blahblah > I want to have a varible in a script.. $user = john > that edits user.conf and changes user=blahblah to user=thevarible$user... > How would

Re: scripting

2002-06-06 Thread Paul Branston
On Thu, Jun 06, 2002 at 04:18:04AM -0500, Jesse Angell wrote: > Okay I used SED worked great.. turned hours of work into less then a > second.. > Now here is where it gets trick to me.. I need to add > > DocumentRoot /var/www/virtual/$user/html > Servername $user.palaceunlimited.com > ErrorLog /v

RE: scripting

2002-06-06 Thread Stephen_Reilly
Just use echo "" >> /www/conf/httpd.conf and so on... steve -Original Message- From: Jesse Angell [mailto:[EMAIL PROTECTED]] Sent: 06 June 2002 10:18 To: [EMAIL PROTECTED] Subject: Re: scripting Okay I used SED worked great.. turned hours of work into less then a seco

Re: scripting

2002-06-06 Thread Jesse Angell
IL PROTECTED]> Sent: Thursday, June 06, 2002 2:52 AM Subject: Re: scripting > On Thu, Jun 06, 2002 at 02:11:31AM -0500, Jesse Angell wrote: > > Okay, > > There is a file lets call it user.conf > > on line 23 of the file there is a line that says > > user=blahblah

Re: scripting

2002-06-06 Thread Paul Branston
On Thu, Jun 06, 2002 at 02:11:31AM -0500, Jesse Angell wrote: > Okay, > There is a file lets call it user.conf > on line 23 of the file there is a line that says > user=blahblah > I want to have a varible in a script.. $user = john > that edits user.conf and changes user=blahblah to user=thevarib

Re: Scripting help needed

2001-01-29 Thread Cameron Simpson
I wrote: | Note that a stay packet can bring up the link, [...] s/stay/stray/ Doh! -- Cameron Simpson, DoD#743[EMAIL PROTECTED]http://www.zip.com.au/~cs/ "Yeh, Buddy.. I've got your COMPUTER! Right HERE!!" (computer THIS!) - Larry Cunningham, [EMAIL PROTECTED] ___

Re: Scripting help needed

2001-01-29 Thread Cameron Simpson
| > Also worth remembering is that ppp has an "on demand" mode. You have | > ppp in this mode at boot and it doesn't start the modem, just sets | > routes. When you try to send data over the link it starts the modem. | > Which means you can pretend it's up and let ppp do the dial-out bit | > itsel

Re: Scripting help needed

2001-01-29 Thread Merell L. Matlock, Jr.
* Cameron Simpson ([EMAIL PROTECTED]) [010127 19:08]: > Also worth remembering is that ppp has an "on demand" mode. You have > ppp in this mode at boot and it doesn't start the modem, just sets > routes. When you try to send data over the link it starts the modem. > Which means you can pretend it

Re: Scripting help needed

2001-01-29 Thread Justin Zygmont
another trick is the files in /var/ru. On Mon, 29 Jan 2001, Thierry ITTY wrote: > ifconfig tells you whether your ppp connection is active or not. then it's > up to you to connect conditionnally > > # my app > ifconfig | grep "ppp0" || start_ppp_script > start app X > > > or something like t

Re: Scripting help needed

2001-01-29 Thread Thierry ITTY
ifconfig tells you whether your ppp connection is active or not. then it's up to you to connect conditionnally # my app ifconfig | grep "ppp0" || start_ppp_script start app X or something like that A 14:11 27/01/2001 -0500, vous avez écrit : >Howdy folks, > >Can someone help to pull the wool

Re: Scripting help needed

2001-01-28 Thread Edward Dekkers
> I cna get the 'not active' part to work, but just can't figure out how > to detect if ppp0 is up and running. > > Any hints/pointers will be most appreciated. > > Thanks, > > Merell Hi Merrell, I see you have allready some answers but I use this: pppisup(){ [ "`/sbin/route -n|/bin/grep -E

Re: Scripting help needed

2001-01-27 Thread Cameron Simpson
On Sat, Jan 27, 2001 at 02:44:44PM -0500, rpjday <[EMAIL PROTECTED]> wrote: | On Sat, 27 Jan 2001, Merell L. Matlock, Jr. wrote: | > X needs to run if my dial-up connection is active, but if the dial-up | > is *not* active, it needs to dialup, run then disconnect. | > I cna get the 'not active' pa

Re: Scripting help needed

2001-01-27 Thread Cameron Simpson
On Sat, Jan 27, 2001 at 01:27:36PM -0800, Brad Doster <[EMAIL PROTECTED]> wrote: | Is there a known host address that you can only ping thru the ppp interface? | If so, you might script a ping test, then let X act based on the result | code. Something like this might work: | | #Wait for 4

RE: Scripting help needed

2001-01-27 Thread Brad Doster
Is there a known host address that you can only ping thru the ppp interface? If so, you might script a ping test, then let X act based on the result code. Something like this might work: #Wait for 4 'echo reply's or 10 seconds, whichever is greater #NOTE: -w does not work under k

Re: Scripting help needed

2001-01-27 Thread rpjday
On Sat, 27 Jan 2001, Merell L. Matlock, Jr. wrote: > Howdy folks, > > Can someone help to pull the wool out of my eyes? > > I need to do a job called 'X'. > > X needs to run if my dial-up connection is active, but if the dial-up > is *not* active, it needs to dialup, run then disconnect. > > I cn

Re: scripting help / question

2000-11-14 Thread Michael R. Jinks
arco Shaw [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 14, 2000 12:32 AM > To: [EMAIL PROTECTED] > Subject: Re: scripting help / question > > You might have to be more specific on your goal. find with -exec will be > able to do certain things on files, and a for loop will

RE: scripting help / question

2000-11-14 Thread Stephen_Reilly
ls -la s* | awk '{print $9}' | sed "s/^./grep -i \'&/g" | sed "s/$/\' file/g" > srcipt.sh is really evil looking steve -Original Message- From: Marco Shaw [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 14, 2000 12:32 AM To: [EMAIL PR

Re: scripting help / question

2000-11-13 Thread Ed Lazor
At 08:31 PM 11/13/2000 -0400, you wrote: >You might have to be more specific on your goal. find with -exec will be >able to do certain things on files, and a for loop will also be able do >things to a list. > >Marco k, here goes: - first program creates a bunch of output like this ##

Re: scripting help / question

2000-11-13 Thread Cameron Simpson
On Mon, Nov 13, 2000 at 04:32:53PM -0800, Ed Lazor wrote: | How can I take output from an awk command and run a command on each line? | | For example: | | ls -la s* | awk '{print $9}' | | would create several lines of output and I'd like to do something like grep | the lines from a file. The

Re: scripting help / question

2000-11-13 Thread Marco Shaw
You might have to be more specific on your goal. find with -exec will be able to do certain things on files, and a for loop will also be able do things to a list. Marco - Original Message - From: "Ed Lazor" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 13, 2000 8:32

Re: [REDHAT] Re: Scripting scp

2000-09-19 Thread Sam Bayne
UM, one poster had the simple answer, which is to change the way ssh authenticates. You can either set up a passwordless RSA authentication key, or you can use .shosts. Unlike with the r-utils(rsh,rlogin,rcp) the s-utils(ssh,slogin,scp) check the host keys to at least verify that the two hosts

Re: [REDHAT] Re: Scripting scp

2000-09-16 Thread David Kramer
On Sat, 2 Sep 2000, Gene Wilburn wrote: > On Fri, 1 Sep 2000, Steven W. Orr wrote: > > > You need to write your script to run scp in the expect scripting > > language. Expect is an extention of tcl. Easy to use and easy learn. Your > > problem is that the request for the password is not supposed

Re: Scripting scp

2000-09-02 Thread Steven W. Orr
Sorry. I didn't understand. You could install something like perl-Expect.pm-1.07-2 Does this help? -- -Time flies like the wind. Fruit flies like a banana. [EMAIL PROTECTED] -Stranger things have happened but none stranger than this. Steven W. Orr- Does your driver's license say Organ Donor?Bla

Re: Scripting scp

2000-09-02 Thread Gene Wilburn
On Fri, 1 Sep 2000, Steven W. Orr wrote: > You need to write your script to run scp in the expect scripting > language. Expect is an extention of tcl. Easy to use and easy learn. Your > problem is that the request for the password is not supposed to come from > stdin; it's supposed to come from /

Re: Scripting scp

2000-09-01 Thread Steven W. Orr
You need to write your script to run scp in the expect scripting language. Expect is an extention of tcl. Easy to use and easy learn. Your problem is that the request for the password is not supposed to come from stdin; it's supposed to come from /dev/console. Expect starts child processes which h

Re: Scripting scp

2000-09-01 Thread Eric Sisler
Gene Wilburn <[EMAIL PROTECTED]> wrote: >I'm trying to replace an existing Perl script that does auto-FTP with scp >(ssh1) instead. The script fetches log files from our ISP and we would >like to close the FTP port entirely. > >The problem I'm having is the absence of a password option to feed >s

RE: Scripting scp

2000-09-01 Thread Anthony Lawson
You can setup scp and ssh to connect/copy files without a password: run "ssh-keygen". When it asks for a pass phrase just hit enter (blank password). It will save two keys (identity and identity.pub) in ~/.ssh/ Copy the identity.pub key to the machine you will be copy files to in the ~/.ssh/ d