~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/extensions/xmlterm/scripts/xcat.csh

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/csh
 
2
# xcat.csh: a C-shell XMLterm wrapper for the UNIX "cat" command
 
3
# Usage: xcat.csh <filename1> <filename2> ...
 
4
 
 
5
##set echocmd="/usr/bin/echo"
 
6
set echocmd="/bin/echo -e"
 
7
 
 
8
foreach file ($*)
 
9
   set ext=${file:e}
 
10
   set firstchar = `echo $file|cut -c1`
 
11
 
 
12
   if ("$firstchar" == "/") then
 
13
      set url="file:$file"
 
14
   else
 
15
      set url="file:$PWD/$file"
 
16
   endif
 
17
 
 
18
   switch ($ext)
 
19
   case "gif":
 
20
   case "png":
 
21
     # Is this a security risk??? Perhaps display using IFRAME?
 
22
     $echocmd "\033{S${LTERM_COOKIE}\007\c"
 
23
     cat <<EOF
 
24
<IMG SRC='$url'>
 
25
EOF
 
26
     $echocmd '\000\c'
 
27
     breaksw
 
28
   default:
 
29
     cat $file
 
30
   endsw
 
31
end