On Sun, Mar 16, 2014 at 09:25:14AM -0400, Martin Perina wrote: [..]
Why don't you do.
mkdir -p ${initdir}/etc/sysconfig echo "$nodes" > ${initdir}$FENCE_KDUMP_NODES
If I do rmdir/mkdir I don't care what's the value of variable. In your case I need to know that FENCE_KDUMP_NODES contains /etc/sysconfig directory and then filename with nodes
sorry, I did not understand what you are trying to say.
If you do this:
mkdir -p ${initdir}/etc/sysconfig echo "$nodes" > ${initdir}$FENCE_KDUMP_NODES
you have to be sure, that FENCE_KDUMP_NODES contains "/etc/sysconfig/FILENAME", otherwise script will fail. And if you change FENCE_KDUMP_NODES (for example to /etc/fence_kdump/fence_kdump.conf) in future, you may also need to change mkdir command path (which may not be that obvious at the first look).
If you do this:
mkdir -p ${initdir}$FENCE_KDUMP_NODES rmdir ${initdir}$FENCE_KDUMP_NODES echo "$nodes" > ${initdir}$FENCE_KDUMP_NODES
you only assume that FENCE_KDUMP_NODES contains valid path ending with filename, even if you change the path in it, you don't have to change mkdir/rmdir command arguments.
Ok, got it. Thanks for the explanation.
I am fine with creation of directory path and removal of last node.
Thanks Vivek