1

I have a rather long csh script that doesnt work, or doesnt work properly. in bash I would do set -xv to get verbose logging. what can I do in cshell? I tried adding set -xv it complained that - isnt allowed, and set xv didnt do anything.

3
  • I do have to point it out : there is a famous Usenet era post "Csh programming considered harmful", and this explicit faq entry : faqs.org/faqs/unix-faq/shell/csh-whynot ... If you can afford it : try to stick to posix sh, if possible at all ? (I know it is not an answer to your question, but I felt obligated to point csh flaws out) Jan 3, 2021 at 22:56
  • I didnt write it man, Im just trying to use some code, and theyre all hell bent on using csh. I tried rewriting their spaghetti code into bash, but it still didnt work, and theyve got arbout 1000 files in 6 languages. Im not going to be rewriting the entire code base. Im just trying to install vmd on an ARM platform
    – j0h
    Jan 3, 2021 at 23:00
  • 1
    I do feel your pain... try to convince them with the above articles. Meanwhile: you can maybe try to use : shellcheck.net ? (it is maybe not Csh-compatible, but most of the code would be parsed and "linted" and will highlight problematic sections) Jan 3, 2021 at 23:06

2 Answers 2

4

You can use

csh -xv script

or you can add

set verbose
set echo

to your script.

2

read the man page! man csh oops, well, I when I call the script I ran $csh -x -v ./script which set verbose mode. actually it has stayed in verbose mode beyond the execution of the one script, but I guess thats fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.