Yes. I know I shouldn't be using it for scripting. Yes. It is rubbish. I am indeed a fool.
Nevertheless.
I'd like to see the commands the script is executing, for debugging purposes. I think you get this effect with set -x or set -v in bash scripts.
So e.g., if the script were
#!/bin/tcsh
echo "Hello"
then when it ran, I'd see
echo "Hello"
Hello
The echo command writes text to standard output (stdout). The syntax of using the echo command is pretty straightforward: echo [OPTIONS] STRING... Some common usages of the echo command are piping shell variable to other commands, writing text to stdout in a shell script, and redirecting text to a file.
Echo is a Unix/Linux command tool used for displaying lines of text or string which are passed as arguments on the command line. This is one of the basic command in linux and most commonly used in shell scripts.
In computing, echo is a command that outputs the strings that are passed to it as arguments. It is a command available in various operating system shells and typically used in shell scripts and batch files to output status text to the screen or a computer file, or as a source part of a pipeline.
Put:
set echo
and/or
set verbose
at the top of your script. That will print out everything that happens in your script and are equivalent to the bash set -x
and set -v
commands.
Lets say your script name is tcsh_file Lets assume this file includes shebang as well.
now run this command on terminal
tcsh -x tcsh_file
this will print every line before executing it. it's basically an interactive mode of execution.
Is this what you needed?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With