LBEM-CH / focus

High Throughput Electron Microscopy Image Processing Software
http://www.focus-em.org
GNU General Public License v2.0
35 stars 14 forks source link

Sourcing csh files with arguments on some platform does not work #171

Closed nikhilbiyani closed 5 years ago

nikhilbiyani commented 7 years ago

On some platforms sourcing CSH files with arguments does not work. In these cases, the arguments have to be left out from the sourcing command and have to added to a variable argv before the sourcing command.

source ${proc_2dx}/a_script.com arg1 arg2

should be changed to

set argv=( "arg1" "arg2" )
source ${proc_2dx}/a_script.com
nikhilbiyani commented 7 years ago

This might also be when csh is different than tcsh on platforms. We should replace csh with tcsh.

PaulVanSchayck commented 7 years ago

I can confirm that with csh-bsd this is indeed a problem. On many debian/ubuntu install I suspect that /bin/csh is set to /bin/bsd-csh and not tcsh.

Fixing this on debian/ubuntu can be done with

sudo update-alternatives --set csh /bin/tcsh

But maybe it's better if this is fixed in the focus scripts.

n1kt0 commented 6 years ago

that worked on Ubuntu 17.10. thx @PaulVanSchayck for the workaround.

rdrighetto commented 5 years ago

Hi,

We don't have to change csh to tcsh, which is better and safer. In modern Linux distros csh is just a link to tcsh. I updated the documentation to make it clearer: https://focus.c-cina.unibas.ch/wiki/doku.php?id=1_0:external-tools#t_csh

PaulVanSchayck commented 5 years ago

Sure tcsh is safer, but it's not the default on the most popular Linux distribution around. Using the wrong shell leads to rather cryptic error messages at rather random places. That these error messages have to be fixed by changing your shell is not obvious. This addition to the wiki will be overlooked.

I would recommend somehow implementing a check to the /bin/csh shell to check whether is in fact tcsh running.

Anyway, my two cents.

rdrighetto commented 5 years ago

Thanks for your tip, Paul. Agree having a check would be good. Speaking for myself, I was surprised to find out that the "old school" csh is still lying around - I thought nowadays it was always tcsh disguised as csh.