0
$\begingroup$

Rosanswers logo

I have a shell script that starts a roslaunch file. I use a shell script, because I provide some arguments before I start the roslaunch.

I'd like to also archive and copy the current log directory for the running roscore process. I know that by running roscd log, I get to the this current directory, but I cannot somehow get to this directory from the shell script.

I tried assigning it to a variable:

log_dir=$(roscd log)

and then running tar -zcvf $log_dir -C $output_dir

But of course nothing is stored in my variable. I am not sure even if this is the correct approach. But I am asking here, as there might be some better ROS specific way of doing such a task.

So, what is the best way to this? Since the name of the log folder is always dynamically generated.

Thanks in advance!


Originally posted by lapadets on ROS Answers with karma: 5 on 2015-06-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

roscd log
log_dir=`pwd` 

Originally posted by lucasw with karma: 8729 on 2015-06-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by lapadets on 2015-06-15:
Thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.