For the following script
install.csh:
#!/bin/csh -f tar -zxf Python-3.1.1.tgz cd Python-3.1.1 ./configure make make install cd .. rm -rf Python-3.1.1
Intended use:
./install.csh |& tee install.log
How can I change the script so that I still get a install.log and the output on console without asking the user to do the redirecting?
Some simple solutions:
Solution 1:
tee every line you want to log independently, make use of
-aswitch of tee to appendSolution 2: Add a second script.
For example, rename current install.csh to install_commands,
then add a new install.csh script: