File: nsopen

package info (click to toggle)
mswordview 0.4.4-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,784 kB
  • ctags: 860
  • sloc: ansic: 8,140; perl: 4,379; makefile: 165; sh: 123; csh: 28
file content (22 lines) | stat: -rwxr-xr-x 411 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/tcsh

if ($#argv != 1) then
    echo "Usage: $0 file"
    exit 1
endif

set file = $argv[1]
if (!(-r $file)) then
    echo "$0: File $file cannot be read"
    exit 1
endif

#Try to open file in an existing netscape window
(netscape -remote "openFile(${file})") >& /dev/null

#if this fails, it means that netscape is not running, so start it
if ($status) then
  netscape -no-install file:${file}
endif