IUBio

pregap, bourne vs C-shell

Stephen Baird sbaird at mgcheo.med.uottawa.ca
Wed Mar 13 18:43:25 EST 1996


James Bonfield (jkb at mrc-lmb.cam.ac.uk) wrote:
: Stephen Baird wrote:

: I can see no reason why this should go wrong. However there are numerous ways
: of trimming white space from a file. I should probably have used "tr -d ' '"
: instead, but tr tends to vary slightly between SysV and BSD systems. You could
: try using awk or perl or something else too. The line in question though
: should work fine on all systems so I really cannot find a problem. Any more
: diagonostics would be useful. Try changing the first line to "#!/bin/sh -x" or
: "#!/bin/sh -v" for debugging output.

#!/bin/sh -x would not allow the script to work in the vepe sections no 
matter whether I was starting from sh or csh, so I could never debug the 
problem.    My guess is the redirection characters ">" "<" , because only 
in the vepe section of pregap do these characters do anything for my 
data and the temporary files created by vepe will exist but not the file 
after sed or tr has taken out the spaces....... but if I write a small 
bourne shell script the redirection works fine even with #!/bin/sh -x 
although a command like

    tr -d ' ' < "${fofn}.passed_tmp" > "${fofn}.passed" 
will  look like

+ tr -d ' '


If I start up sh from my original c-shell and then run pregap, it works 
fine. Pregap started from the cshell gives erratic results. It will get 
to different parts of the script successfully without editing the script 
from one time to another.


: Please don't! Csh is a terrible language. I wouldn't claim it to be the
: "usual" shell either as all systems I know of have both sh and csh.

We use tcsh which has command line editing and easy access to history 
commands with the up and down arrow keys. That part is great for computer 
phobes and neophytes using character based commands with lots of options.

: If you
: really want to know why I detest csh so much try working out how many 'A's
: "repeat 3 repeat 3 echo A" would print.

answer 5    3 + 3 - 1(for good luck) = 5

: Or tell me why the following can't be
: done on a single line "if ($?some_variable) echo $some_variable".

if ($?some_variable == 1) echo $some_variable    # that works for me

: I know csh
: has some useful features, but as far as a language goes it's poor (in my
: opinion).


I am sure you are right that it is a poor language, but I have been able 
to get my c-shell scripts to perform consistently (although sometimes 
consistently bad) and when I run pregap, a Bourne shell script within 
my login c-shell, it does not work all the time.
It surely is  the c-shell or the old operating system and not the 
script, but it does not work consistently.  I now realize that I can work 
around this by starting up sh, but I wanted to see if I could fix it for 
others who do not use computers very easily. When I leave here I would 
like anyone else in the lab to be able to sit down and use your 
programs with the least amount of effort.


: 	James
: -- 
: James Bonfield (jkb at mrc-lmb.cam.ac.uk)   Tel: 01223 402499   Fax: 01223 412282
: Medical Research Council - Laboratory of Molecular Biology,
: Hills Road, Cambridge, CB2 2QH, England.
: Also see Staden Package WWW site at http://www.mrc-lmb.cam.ac.uk/pubseq/


Thank you very much for your suggestions,

|--------------------------------------------------------------------|
| Stephen Baird                        sbaird at mgcheo.med.uottawa.ca  | 
| Molecular Genetics                       tel: 613-738-3925         |
| Children's Hospital of Eastern Ontario   fax: 613-738-4833         |
| 401 Smyth Rd.                                                      |
| Ottawa, Ontario                                                    |
| Canada                                                             |
| K1H 8L1                                                            |
|--------------------------------------------------------------------|





More information about the Staden mailing list

Send comments to us at biosci-help [At] net.bio.net