I have 2 questions about path.
first question is related to 'qsub'
this is my current folder
/home/mtrnn/rnn_class_EE837/src/rnn-learn/result/lissa_1_rec/
in this folder I use
qsub -q public_~~~ ./start.sh
It works well. The problem is whenever I use server, I need to change path in below shell script(start.sh) When I use in different folder, everytime I need to change below code in the start.sh
cd current_path
for example,
cd /home/mtrnn/rnn_class_EE837/src/rnn-learn/result/lissa_1_rec/
It's too bothering thing and it makes path error very often.
Can I delete
cd ~~~~
by using 'pwd' or something?
I mean, read current path using 'pwd' and put this result into shell script as a variable. Is is possible? I think, if I can get the result of 'pwd' as a variable and putting it as a variable of start.sh, I can remove that part. But, I don't how to do it.
This is start.sh
#!/bin/sh
cd /home/mtrnn/rnn_class_EE837/src/rnn-learn/result/lissa_1_rec/
if [ "$1" = clean ]; then
rm -f *.log *.dat target.txt *.scale *.restore
exit
fi
config_file=test_config.txt
connection_file=connection.txt
if [ -f $connection_file ]; then
cp $config_file ."$config_file".tmp
gen_config.sh $connection_file >> ."$config_file".tmp
else
cp $config_file ."$config_file".tmp
fi
../../rnn-learn -i rnn.dat -c ."$config_file".tmp ./target*.txt
#${path2}rnn-generate -n 2000 rnn.dat > orbit.log
rm ."$config_file".tmp
second question is,
#${path2}rnn-generate -n 2000 rnn.dat > orbit.log
in above code, there is ${path2}
I think for start.sh, ${path2} always pointing the folder that rnn-generate is located.
How can I do? If I can know the method, I want to change
../../rnn-learn -i rnn.dat -c ."$config_file".tmp ./target*.txt
to
${path3}rnn-learn ~~~
Ah, now I'm using server and I'm not ministrator.
So, I think , I can't change /etc/bashrc or /etc/environment.
Thank you.