I want to use the script command to see my output both in the command line and also store it at the same time, as suggested here.
Now, I can do in my command line:
script source activate foo python my_file.py exit
Quite a hassle if I have to do this often, so I thought I would write a bash script that automatizes this. I tried to literally paste these commands into a command line file, but it would wait for input after
Instead, here's how I thought of implementing this in a bash script (such that I would just run the script and it would do it all:
#!/bin/bash script ../output.txt -c ' /home/foo/anaconda3/condabin/conda activate myenv3 && python myfile.py'
And this gives me a
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
Why am I not using directly "source activate foo" or ". activate foo" as I would usually do? Well, if I try that, I get
bash: activate: No such file or directory
I understand that
/bin/bash apparently is not configured to do this in Ubuntu -- what should be my way forward?