hi,
i want to create a dummy file even if the path to that file is not exist as follows.
suppose, in my working directory 2 files are there. and
i create one more file which is exist as follows
# pwd
/home/satya
# ls
file1.txt file2.txt
# echo dummy > /home/satya/file3.txt
# ls
file1.txt file2.txt file3.txt
now i want to create a file which path is not exist.
# echo dummy > /home/satya/temp_dir/file4.txt
-bash: /home/satya/temp_dir/file4.txt: No such file or directory
we can create directory and then create dummy file.
but there is a problem when there are more directories to be created.
i need these things with in a script.
input to the script is names of the files with full path in which some directories are not exist like
/dir1/dir2/dir3/dir4/file1.txt
/dir1/dir2/dir5/dir6/file2.txt