In a Unix shell I try the following:
svn_checkout_dir="svn"
svn add "$svn_server" "$svn_checkout_dir/save"
: but the "$svn_checkout_dir/save" will not resolve to "svn/save". Am I us开发者_开发百科ing this in the wrong way?
You have to export the svn_checkout_dir
before calling svn:
export svn_checkout_dir="svn"
svn add "$svn_server" "$svn_checkout_dir/save"
If you don't do that, svn_checkout_dir
is only a local variable, not an environment variable visible to the svn
process. So, in your case (assuming that svn_checkout_dir
and svn_server
are defined the same way), your call evaluates to
svn add "" "/save"
as long as you don't export
svn_server
and svn_checkout_dir
.
If you put your two lines into a script however, it would work as expected since within the script, svn_checkout_dir
is visible as local variable (and overrides a possibly existent environment variable with the same name).
精彩评论