[why] when the $dir not exist, cat > $dir/$file << 'EOF' xxx EOF will echo error message: can not find the file $dir/$file
Signed-off-by: Li Ping 15396232681@163.com --- lib/job2sh.rb | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/job2sh.rb b/lib/job2sh.rb index 9c95ff4b..7e6a5d7c 100755 --- a/lib/job2sh.rb +++ b/lib/job2sh.rb @@ -350,6 +350,7 @@ class Job2sh < Job out_line out_line "\texport define_files='#{define_files.keys.join ' '}'" define_files.each do |file, val| + out_line "\tmkdir -p $LKP_SRC/$(dirname #{file})" out_line "\tcat > $LKP_SRC/#{file} <<'EOF'" out_line val out_line "EOF"