ipython jupyter notebook pass variable to command line code example
Example: jupyter notebook pass python variable to shell
dir_path = "/home/foo/bar"
!cp file1 $dir_path
dir_path = "/home/foo/bar"
!cp file1 {dir_path}
!cp file1 {dir_path + sub_dir}