Script Translation

Date: Sun, 22 Dec 1996 12:06:54 -0400
From: David Trueman <david@cs.dal.ca>
To: James Fifield <fifield@ug.cs.dal.ca>
cc: csuite-tech@chebucto.ns.ca, Trent MacDougall <trent@cs.dal.ca>
Precedence: bulk

next message in archive
no next message in thread
previous message in archive
Index of Subjects


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-851401618-851134207=:10862
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.SUN.3.91.961222120122.17906I@cs.dal.ca>

On Fri, 20 Dec 1996, James Fifield wrote:

> Well, with a fair bit of a learning curve, (have no clue about syntax) I 
> think i have a completed a script.  If you get a minute sometime, can you 
> take a look at it... there's no rush.
> 
> To be honest, I'm really not sure how to check to see if it works.  
> However, it all seems pretty straight forward, maybe I'll earn some money 
> after all. :D*

I have commented what you did below.  I hope you will forgive me for 
cc:ing the list on this but I think some others migth benefit from the 
comments.  A few comments go beyond the translation preparation that you
were supposed to be doing.

Some general comments:

1. work from the CVS repository if at all possible -- Landon can help get 
you set up.

2. get set up to install on a working CSuite system like phat or landon so
that you can test (and break) sscripts.

3. do not go out of your way to exclude HTML markup from the quoted 
strings -- that can jsut be left in the translated versions.

4. do not let any of the above keep you from proceeding -- refinement and 
testing can come after if necessary

Below, I have preceded my replacement code with >>>> and comments with ####

#! /bin/sh

# Copyright (C) 1995, 1996 Chebucto Community Net Society
# This file is part of Chebucto Suite.  Use is governed by the terms
# laid out in the file COPYRIGHT.

# template version 1.0

## quota-view - allow authorised users to view other users quota

. $DOCUMENT_ROOT/.cgi-funclib

cs_html_head -t "userhelp Quota View"

>>>>> cs_html_head -t userhelp "Quota View"
##### the first arg. after -t is the mail address for a mailto: link
##### and the rest is the title

trap cs_html_foot 0

cd /tmp

case "$cgi_LOGIN" in
"")	;;
*)	sudo=sudo
	;;
esac

echo '<pre>'

eval $sudo quota -v $cgi_LOGIN

echo '</pre>'

echo "You must RELOAD this page to get current values (use control-R)." '<p>'

echo '' "An explanation of what these numbers mean" ''

#### strictly speaking, the $WEBHOST above should also be in "" just in case
#### it contains characters that the shell might interpret -- right now it is
#### outside any quotes

groups=`groups`
case "$groups" in
*quota*|*wheel*)
	echo ' "<p>" "To view the quota of another user, first"

#### There should be no ' in the above line or the " will not get interpreted,
#### but rather preserved

	<a href="lynxexec:/ccn/bin/sudo -v">
>>>> echo '<a href="lynxexec:@@@CS_ROOT@@@/bin/sudo -v">'
#### there should be no /ccn in that, but also, you should really get the
#### source to work on from the CVS repository, otherswise some substitutions
#### will already have been made

	"Update your sudo permissions" "</a>" ", then enter the login name below" "<p>"'

####  add echo to the fornt of that and take the ' off the end

	echo '<FORM METHOD=POST ACTION="quota-view">
	"Login name": <INPUT TYPE=TEXT NAME=LOGIN VALUE='$cgi_LOGIN'>
	</FORM>'
	;;
esac
---559023410-851401618-851134207=:10862--


next message in archive
no next message in thread
previous message in archive
Index of Subjects