ez scripting question

ez scripting question

Post by lego » Thu, 28 Feb 2002 04:34:54



i hope im not being vague. but i have a script and i want to put a
pointer to it within anohter script file.

the line i put in before  worked  in this place  with the syntax
ftp -n ftp.remotehost.com etc etc

but now i have a script calling up all of the ftp commands etc.
so i placed this line instead
/path/to/script/scriptname argument1 arguement2 arguement3  

it doesnt work.. what should i do.

i tried back quotes on the scriptname, and diferent variatons of
places. paths ./scripts, which syntax works.

btw
i can run this at the c/l and it works like crazy
/path/to/script/scriptname argument1 arguement2 arguementt3

ez, right?

lego

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

ez scripting question

Post by Barry Margoli » Thu, 28 Feb 2002 04:32:43




>i hope im not being vague. but i have a script and i want to put a
>pointer to it within anohter script file.

>the line i put in before  worked  in this place  with the syntax
>ftp -n ftp.remotehost.com etc etc

>but now i have a script calling up all of the ftp commands etc.
>so i placed this line instead
>/path/to/script/scriptname argument1 arguement2 arguement3  

>it doesnt work.. what should i do.

>i tried back quotes on the scriptname, and diferent variatons of
>places. paths ./scripts, which syntax works.

>btw
>i can run this at the c/l and it works like crazy
>/path/to/script/scriptname argument1 arguement2 arguementt3

>ez, right?

It should work.  Commands in a script are executed the same as commands
typed interactively (assuming your interactive shell is the same as the
shell your script is written in).

Post the whole script, maybe we'll see the problem.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

ez scripting question

Post by lego » Thu, 28 Feb 2002 05:30:51


thanks i had to type this out. but mostly ithe lline that is mine is
the sleep 30 and the next one. my script was posted here 3 hours ago .
subject: automate ftp. it is fixed and runs under c/l, no prob its
called upload.

#!/bin/sh
#
PATH=/bin:/etc:/tmp
export PATH
. /etc/system.cfg
. /etc/live.cfg
. /etc/chat.pwd
. /etc/dyndns.cfg

case $ROUTER in dialup|leased)
        [$4 = 1.1.1.1 -o $4 = 1.1.1.2 ] && exit 0
        I=$4
        echo "our inet addr: $4<br>ISP P-t-P: $5 >/tmp/state
        cat /mnt/router/ppp/index.html | sed -e s/--IP--/$4/g

Quote:>/tmp/index.html

        for i in `cat /etc/forward.cfg`: do
                set -- ""
                if [ ! "`echo$i |sed -n /

        #       i have to type this out and it goes on for a few lines
        #       so far line 14 is the only one that is mine begins
w/cat
        #       it works well, heres two more lnes, then mine begin
with sleep
        #       and the next one is mine too

        ipportfw -A -$1 $I/$2 -R $3
        fi
        sleep 30
        `mnt/router/ppp/upload` ftp.california.com index.html username
pass
        done
        [ "$DYNNAME" ] && fork dyndns $I
        synctime;;
        esac
        exit



>>i tried back quotes on the scriptname, and diferent variatons of
>>places. paths ./scripts, which syntax works.

>>btw
>>i can run this at the c/l and it works like crazy
>>/path/to/script/scriptname argument1 arguement2 arguementt3

>>ez, right?

>It should work.  Commands in a script are executed the same as commands
>typed interactively (assuming your interactive shell is the same as the
>shell your script is written in).

>Post the whole script, maybe we'll see the problem.

>--

>Genuity, Woburn, MA
>*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
>Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 
 
 

ez scripting question

Post by Barry Margoli » Thu, 28 Feb 2002 05:47:39




>thanks i had to type this out. but mostly ithe lline that is mine is
>the sleep 30 and the next one.

Why couldn't you just cut and paste it in, instead of typing it out?  One
of the errors I mention below could be a typo that you made when

Quote:>                            my script was posted here 3 hours ago .
>subject: automate ftp.

If this is already being discussed in another thread (which I haven't been
reading), it would probably be better to stay in that thread.  It's
confusing to discuss the same problem in two threads.

Quote:>                    it is fixed and runs under c/l, no prob its
>called upload.
...
>    `mnt/router/ppp/upload` ftp.california.com index.html username pass

That will execute the command mnt/router/ppp/upload with no arguments.  The
backticks then cause the output of that command to be substituted back into
the command line, and that resulting command executed with four arguments.

Is that what you wanted?  If those are supposed to be arguments to the
upload script, it should be:

      mnt/router/ppp/upload ftp.california.com index.html username pass

Another thing: you left out the initial '/' on the pathname to the upload
command, so this script will only work if your current directory contains
the 'mnt' directory.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

ez scripting question

Post by lego » Thu, 28 Feb 2002 06:14:06


believe me , i know, and im sorry, but the editor is so rudimentry, ok
, wait a min,
ill try floppynet
i need to learn how to think more flexibly!
thanks a lot everybody.
and i will consider very strongly your password suggestions
right now i just want to be up
my line is the one that goes /mnt/router/etc
the contents of teh ftp script is below that
#!/bin/sh
#
PATH=/bin:/etc:/tmp
export PATH
. /etc/system.cfg
. /etc/live.cfg
. /etc/chat.pwd
. /etc/dyndns.cfg
# Add commands here

# Don't edit below
case $ROUTER in dialup|leased)
        [ $4 = 1.1.1.1 -o $4 = 1.1.1.2 ] && exit 0
        I=$4
        echo "Your inet addr: $4<br>ISP P-t-P: $5" >/tmp/state
cat /mnt/router/ppp/index.html | sed -e s/--IP--/$4/g >/tmp/index.html
        for i in `cat /etc/forward.cfg`; do
                set -- ""
                if [ ! "`echo $i | sed -n /_/P`" ]; then
                        set -- `echo $i | sed s/,/\ /g`
                        ipportfw -A -$1 $I/$2 -R $3
                fi
        sleep 30
        `/mnt/router/ppp/upload` ftp.california.com index.html user
pass
        done
        [ "$DYNNAME" ] && fork dyndns $I
        synctime;;
esac
exit 0
#!/bin/sh

USERNAME="lxxx"
PASSWORD="3xxxxx"
HOSTNAME=$1
FILENAME=$2
LOGINNAME=$3
LOGINPASS=$4

if [ $# -ne 2 ]
then
        USERNAME=$3
        PASSWORD=$4
fi

ftp -n $HOSTNAME <<EOF
user $USERNAME $PASSWORD

cd  html
lcd /tmp/
put index.html
bye
quit
EOF





>>thanks i had to type this out. but mostly ithe lline that is mine is
>>the sleep 30 and the next one.

>Why couldn't you just cut and paste it in, instead of typing it out?  One
>of the errors I mention below could be a typo that you made when

>>                                my script was posted here 3 hours ago .
>>subject: automate ftp.

>If this is already being discussed in another thread (which I haven't been
>reading), it would probably be better to stay in that thread.  It's
>confusing to discuss the same problem in two threads.

>>                        it is fixed and runs under c/l, no prob its
>>called upload.
>...

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 
 
 

ez scripting question

Post by Barry Margoli » Thu, 28 Feb 2002 06:27:54




>    `/mnt/router/ppp/upload` ftp.california.com index.html user pass

You fixed the missing '/', but you still have the backticks.  Does the
upload command really output a command name?

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

ez scripting question

Post by lego » Thu, 28 Feb 2002 06:49:28


thanks, this is great

backticks, yes.. or no?
i dont  understand ur ?
the upload is not a 'command' , its that script below, i'm sorry for
stating the obviou





>>        `/mnt/router/ppp/upload` ftp.california.com index.html user pass

>You fixed the missing '/', but you still have the backticks.  Does the
>upload command really output a command name?

>--

>Genuity, Woburn, MA
>*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
>Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 
 
 

ez scripting question

Post by lego » Thu, 28 Feb 2002 06:58:12


thanks, this is great,
backticks good or bad??
i dont know what u mean by the upload command. its a script, sorry ,
im confused,
what it outputs ?
i dont think it outputs a command name, it reqires all of those
arguments, the ftp.california.com index.html, user.

its all there i think, like i said it runs from c/l

?
i m not sure what you are asking, sorry





>>        `/mnt/router/ppp/upload` ftp.california.com index.html user pass

>You fixed the missing '/', but you still have the backticks.  Does the
>upload command really output a command name?

>--

>Genuity, Woburn, MA
>*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
>Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 
 
 

ez scripting question

Post by Barry Margoli » Thu, 28 Feb 2002 07:09:14




>thanks, this is great

>backticks, yes.. or no?

You understand that the purpose of backticks is to run a program, collects
its output, and then substitute that output back into the command line,
don't you?  E.g.

echo `ls foo*`

will execute the command "ls foo*" and then use its output as the arguments
to the "echo" command.

So when you do:

`/mnt/router/ppp/upload` ftp.california.com index.html user pass

it will run the upload script, and take whatever output it produces, which
I'll refer to as XXX, and then execute:

XXX ftp.california.com index.html user pass

If that's not what you want, get rid of the backticks.

Quote:>i dont      understand ur ?
>the upload is not a 'command' , its that script below, i'm sorry for
>stating the obviou

I'm sorry for using confusing terminology, a script is just one way of
creating a command.

I didn't realize that your script calls itself.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

ez scripting question

Post by lego » Thu, 28 Feb 2002 07:45:22


no i didnt understand that completely till now, thanks ... and it
doesnt run that way either, so ive elimnated them.
but i only put them in after running the string unmodified, like i

i keep thinking its the nature of the command and how it fits with the
others. im not theory-strong, so im a guesser. so despite that it said
dont edit below, i put that sed script right below the other similaar
command. and it works flawlessly. that's why i sleep for 30 sec. i
dont know if this is relevant. but my unitiiated mind is thinking
sequence when syntax seems to be at least adequate. i will run it
sommore, i had lunch, maybe it feels like running



bgb



>>thanks, this is great

>>backticks, yes.. or no?

>You understand that the purpose of backticks is to run a program, collects
>its output, and then substitute that output back into the command line,
>don't you?  E.g.

>echo `ls foo*`

>will execute the command "ls foo*" and then use its output as the arguments
>to the "echo" command.

>So when you do:
>`/mnt/router/ppp/upload` ftp.california.com index.html user pass

>it will run the upload script, and take whatever output it produces, which
>I'll refer to as XXX, and then execute:

>XXX ftp.california.com index.html user pass

>If that's not what you want, get rid of the backticks.

>>i dont  understand ur ?
>>the upload is not a 'command' , its that script below, i'm sorry for
>>stating the obviou

>I'm sorry for using confusing terminology, a script is just one way of
>creating a command.

>I didn't realize that your script calls itself.

>--

>Genuity, Woburn, MA
>*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
>Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 
 
 

ez scripting question

Post by lego » Thu, 28 Feb 2002 08:30:12


it simply runs perfecly from the c/l and not anywhere i put it in that
file. i think im going to start over with this install ( a floppy !)
im living dangereously anyway, havent backed up. then i can put
everything inits place and try again. somewhere somethining is being
thrown and not being caught. i just lookd over permissions/ownership,
etc. time to stop noodling, i guess


>no i didnt understand that completely till now, thanks ... and it
>doesnt run that way either, so ive elimnated them.
>but i only put them in after running the string unmodified, like i

>i keep thinking its the nature of the command and how it fits with the
>others. im not theory-strong, so im a guesser. so despite that it said
>dont edit below, i put that sed script right below the other similaar
>command. and it works flawlessly. that's why i sleep for 30 sec. i
>dont know if this is relevant. but my unitiiated mind is thinking
>sequence when syntax seems to be at least adequate. i will run it
>sommore, i had lunch, maybe it feels like running



>bgb


>>>thanks, this is great

>>>backticks, yes.. or no?

>>You understand that the purpose of backticks is to run a program, collects
>>its output, and then substitute that output back into the command line,
>>don't you?  E.g.

>>echo `ls foo*`

>>will execute the command "ls foo*" and then use its output as the arguments
>>to the "echo" command.

>>So when you do:

>>`/mnt/router/ppp/upload` ftp.california.com index.html user pass

>>it will run the upload script, and take whatever output it produces, which
>>I'll refer to as XXX, and then execute:

>>XXX ftp.california.com index.html user pass

>>If that's not what you want, get rid of the backticks.

>>>i dont      understand ur ?
>>>the upload is not a 'command' , its that script below, i'm sorry for
>>>stating the obviou

>>I'm sorry for using confusing terminology, a script is just one way of
>>creating a command.

>>I didn't realize that your script calls itself.

>>--

>>Genuity, Woburn, MA
>>*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
>>Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

>-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 
 
 

ez scripting question

Post by Barry Margoli » Fri, 01 Mar 2002 01:47:11




>it simply runs perfecly from the c/l and not anywhere i put it in that
>file. i think im going to start over with this install ( a floppy !)
>im living dangereously anyway, havent backed up. then i can put
>everything inits place and try again. somewhere somethining is being
>thrown and not being caught. i just lookd over permissions/ownership,
>etc. time to stop noodling, i guess

What specific error do you get when it fails?

Another thing I noticed is that whenever you post your script, the "pass"
argument is on the line *after* /mnt/router/ppp/upload, instead of at the
end of the line.  I don't know if this wrapping is only being done when you
post, or also when you edit the script itself.  When editing scripts, make
sure you don't use an editor that automatically wraps long lines.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. Patritioning WD 8.4 GB drive and Linux and EZ-Drive/EZ-Bios

Hi

I just installed a Western Digital 8.4 GB drive on my Micron machine
with a Micronics M54Hi motherboard as the second drive.  This has the
PhoenixBIOS 4.04 which cannot support disks larger than 7.8 GB.  There
is a BIOS (v5.05) upgrade available from Micro Firmware but for $79!  I
installed the WD EZ-Drive software and it partitioned the drive in 4
with about 2.1 GB per partition.  I can see these partitions OK in Win95
(though I do have a spurious E: drive that cannot be accessed).

In Linux (RedHat 4.1 - yes, part of the reason of getting the new drive
was to upgrade to RH5.2), fdisk sees only the first partition of the hard
drive (as /dev/hdb1 with about 2.1GB) with the rest of the drive seen as one
partition with unknown type.  If I use linux fdisk to partition the disk
in what I _think_ is the same partitions as EZ-Drive used then Win95 sees
the first partition but cannot read the other three.  Repartitioning the
drive with EZ-Drive causes the original problem (i.e. can only see the two
partitions in Linux).  

I know Western Digital claims that EZ-Drive does not support Unix but
the Large Disk mini-HOWTO claims that Linux will work with EZ-Drive.  I
seem to be almost there.  Has anyone got this working or have any
suggestions?

Thanks in advance for any advice.

Leslie Groer

2. IP forwarding help (please)

3. EZ WORDPROCESSOR QUESTION!

4. Multihoming many virtuals under Apache

5. ez iptables question

6. initrd and devfs

7. EZ Questions

8. SVR4 Virtual File System

9. Syquest ez-135 parallel port question

10. Syquest EZ drive 135 SCSI question

11. EZ PROCESSOR (NEW QUESTION) PLEAASE HELP!

12. Newbie ez-ipupdate/startup question

13. Partition Questions Using EZ-drive