Ultimate Netscape script.

Ultimate Netscape script.

Post by James Saint-Ross » Wed, 13 May 1998 04:00:00



Well, here is the script I use for executing netscape.   It allows you
to invoke multiple browser windows using the same call (works well as a
fvwm button).  It can also handle old lock files.  It redirects errors
to the xconsole so you can see them while using X.  Tell me what you
think.  Feel free to suggest improvements.

#!/bin/sh
if [ -h ~/.netscape/lock ]
then
   if (netscape -remote 'openBrowser()') 2> /dev/console
   then :
   else
      ( rm ~/.netscape/lock ; netscape) &
   fi
else
   netscape &
fi

 
 
 

Ultimate Netscape script.

Post by Per Hov » Wed, 13 May 1998 04:00:00



> Feel free to suggest improvements.

> #!/bin/sh
> if [ -h ~/.netscape/lock ]

Not all versions of Bourne Shell supports the use of ~. Use $HOME instead.

Quote:>    if (netscape -remote 'openBrowser()') 2> /dev/console
>    then :
>    else
>       ( rm ~/.netscape/lock ; netscape) &
>    fi

A shorter version of the same is
  if ! (netscape -remote...
  then
     (rm $HOME/.netscape/lo...
  fi


start your script with arguments, i.e. 'yourscript.sh www.somewhere.com'

to a single empty argument if $# = 0 (this is wrong! It's correct
behaviour for "$*" though). So in order to be portable, i'd rather use

If you decide to call the script netscape, you will (as I'm sure you know)
use the full path to netscape in the script itself to avoid loops, or
perhaps move the netscape binary away (say, to netscape.exe) and execute
netscape.exe from the netscape script).

per kristian
--
UNIX is a four-letter word.

 
 
 

Ultimate Netscape script.

Post by Per Hov » Wed, 13 May 1998 04:00:00




> > #!/bin/sh
> > if [ -h ~/.netscape/lock ]

> Not all versions of Bourne Shell supports the use of ~. Use $HOME instead.

I'd also use -f instead of -h. I assume it's just a typo.

per kristian
--
UNIX is a four-letter word.

 
 
 

Ultimate Netscape script.

Post by James Saint-Ross » Thu, 14 May 1998 04:00:00


Thanks for you input Per Hove.  Your suggestions are very helpful.

Quote:> I'd also use -f instead of -h. I assume it's just a typo.

actually this isn't a typo if you look at the lock file it is a symbolic link
to your IP#.  For FreeBSD the -h switch is used and for linux (bash) you have
to use -L.  Alas no portability here :-(
 
 
 

Ultimate Netscape script.

Post by Mats Lofkvis » Thu, 14 May 1998 04:00:00


[ checking for symlinks ]

Quote:> FreeBSD the -h switch is used and for linux (bash) you have
> to use -L.  Alas no portability here :-(

-h works with bash (1.14 and 2.0) and seems to be standard on most unixes
(at least on sunos4, sunos5, hpux9, irix6, freebsd).

I didn't find any other than bash and sunos5 that handles -L.

 
 
 

Ultimate Netscape script.

Post by Mikhail Teter » Thu, 14 May 1998 04:00:00


Honorable James Saint-Rossy

Quote:>> I'd also use -f instead of -h. I assume it's just a typo.

=
=actually this isn't a typo if you look at the lock file it is a symbolic link
=to your IP#.  For FreeBSD the -h switch is used and for linux (bash) you have
=to use -L.  Alas no portability here :-(

-e ? Exists...

        -mi

--
        "Windows for dummies"

 
 
 

Ultimate Netscape script.

Post by Per Hov » Thu, 14 May 1998 04:00:00



> Honorable James Saint-Rossy

> =actually this isn't a typo if you look at the lock file it is a symbolic link
> =to your IP#.  For FreeBSD the -h switch is used and for linux (bash) you have
> =to use -L.  Alas no portability here :-(

> -e ? Exists...

No. Not on Solaris sh.

per kristian
--
UNIX is a four-letter word.

 
 
 

Ultimate Netscape script.

Post by James Saint-Ross » Thu, 14 May 1998 04:00:00


OK, here is the new and improved Ultimate Netscape script (thanks for the input
Hove).

I called the script "multinetscape" to avoid confusion

#!/bin/sh

then

fi

With this script you can
  invoke multiple netscape browser windows
  use URL's on the command line
  deal with stale lock files

I wounder if there is a less cumbersome way of quoting this?

 
 
 

Ultimate Netscape script.

Post by Per Hov » Fri, 15 May 1998 04:00:00



> #!/bin/sh

> then

> fi

> I wounder if there is a less cumbersome way of quoting this?

You don't need the () around the commands. My netscape doesnt recognice
the command openBrowser either (it's version 3 though), but
openURL(http://etcetera,new-window) does. If this works on NS4 too, it's
best to use the one that works with both 3 and 4. So this might work:

<--- BEGIN SCRIPT
#!/bin/sh


<--- END SCRIPT

I'd use {} after the '||' instead of (), so i don't start another shell.
{} just groups commands together.

Just minor things though:


argument contains a tab or a space. But in an openURL() statement, it is

is enough.

Try to run this and you'll see what i mean:
#!/bin/sh
set -- one two three "fo ur"

n=0
while test "$1";do n=$(($n+1)); echo "$n: $1"; shift;done
echo
set -- one two three "fo ur"

n=0
while test "$1";do n=$(($n+1)); echo "$n: $1"; shift;done

per kristian
--
UNIX is a four-letter word.

 
 
 

Ultimate Netscape script.

Post by Peter Johanss » Sat, 16 May 1998 04:00:00



Quote:> Well, here is the script I use for executing netscape.   [ snip ]

Cool.  Here's the one I've been using for the past few years.  Only
real difference is that it works on files as well as urls.

#!/bin/sh
#
# n - an intelligent netscape handler
#

if [ -l $HOME/.netscape/lock ]; then
    if [ $# -lt 1 ]; then
        exec /usr/local/bin/netscape -noraise -remote "openURL(http://www.widgetworks.com/~peter/Hotlist,new-window)"
    else
        if [ -r $1 ]; then
                if [ "`echo $1 | cut -c1-1`" = "/" ]; then
                        file=$1
                else
                        file="`pwd`/$1"
                fi
                exec /usr/local/bin/netscape -noraise -remote "openFile($file,new-window)"
        else
                exec /usr/local/bin/netscape -noraise -remote "openURL($1,new-window)"
        fi
    fi
else
    exec /usr/local/bin/netscape $*
fi

--
Peter Johansson

 
 
 

Ultimate Netscape script.

Post by David Malo » Sat, 16 May 1998 04:00:00




>> Well, here is the script I use for executing netscape.   [ snip ]
>Cool.  Here's the one I've been using for the past few years.  Only
>real difference is that it works on files as well as urls.

We have quite a different netscape script here which works by
locating the machine with the lowest load, and then rsh'ing to
that machine and running netscape. It also makes a default
.netscape/preferences file.

Does anyone know if netscape have a global config file that it
will use as a default for all users these days?

        David.

 
 
 

Ultimate Netscape script.

Post by Dinesh Nai » Sun, 17 May 1998 04:00:00


hey,

i'm on 2.2.6-RELEASE running the i'ntl version of netscape communicator
4.04. this host dials up to the isp and retrieves mail and news. so far,
so good.

the problem arises when i try to start netscape while not connected to
the isp, i.e. no nameservice. the netscape process starts and forks a
(dns helper) (netscape) process and then does nothing. no window or
anything. top shows that the parent netscape process is gobbling CPU.
yes, i've got a local newsserver and the newssever is specified as
localhost in netscape's preferences. and yes, i have got "hosts" before
"bind" in /etc/host.conf and localhost does have an entry in /etc/hosts.

any clues ?

--
Regards,                        /\_/\   "All dogs go to heaven."

+=======================----oOO--(_)--OOo----=========================+
|for a in past present future; do                                     |
| for b in clients employers associates relatives neighbours pets; do |
| echo "The opinions here in no way reflect the opinions of my $a $b."|
|done; done                                                           |
+=====================================================================+
http://pgp.ai.mit.edu/htbin/pks-extract-key.pl?op=get&search=0x230096E9

 
 
 

Ultimate Netscape script.

Post by David Malo » Sun, 17 May 1998 04:00:00



>the problem arises when i try to start netscape while not connected to
>the isp, i.e. no nameservice. the netscape process starts and forks a
>(dns helper) (netscape) process and then does nothing. no window or
>anything. top shows that the parent netscape process is gobbling CPU.

I've had this problem too and no luck in tracking it down. I have
named running locally and the nameserver listed as 127.0.0.1. However
I find if I kill netscape and restart it again enough times it starts
to work again. There don't seem to be any problems once it gets going.

        David.

 
 
 

1. Non Netscape Proxy between Netscape Commerce Server & Netscape Browser

When trying to access http://www.internet.net/ we received the following
error within Netscape:

Error 400
Invalid request "CONNECT www.internet.net:443 HTTP/1.0" (unknown method)

When accessing the page through Mosaic we get the page without any errors!

Looking further into this, we realized that the http site was using a Netsite-Commerce/1.0 server.  Another note is internally we access the outside
world using a proxy server(CERN). On further investigation, we realized
that our environment variable in Netscape, Security Proxy, was set to our
proxy server.  Yet our proxy server (CERN) does not offer any of the
security methods.

How can we enable the CERN Proxy server to be able to pass through Netscapes security queries?  Any information would be helpful!

                        Thanks,
                        Vicki.


2. Starting pump at bootup

3. Execute a sh script under perl and sh: sh script; perl script?

4. Linux network

5. The ultimate Entertainment System

6. UPS shutdown software for Unix available via download

7. SCSI AHA2940 - The ultimate solution

8. Setting up a firewall/Booting from floppy

9. The Ultimate Operating System News

10. "The Ultimate Argument Against Linux"

11. Building the Ultimate Student Workstation

12. Linux - The Ultimate Weapon

13. Help: Apple Network Server 500 and IX3D ultimate rez and RAID