Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verification before copying.

Status
Not open for further replies.

ranjank

IS-IT--Management
May 9, 2003
176
IN
I need to verfiy whether the same directory exists in other server where i'm copying.

For E.g: If i want to copy a "a" directory which i input thru command line with $1 in other server how can i confirm whether the input which i take as $1 exists in other server.

Regards,
RK.
 
Hi

I do not know how you reach the other server, but for checking if a directory exist, this is the base movement :
Code:
test -d "$1" && echo "exist"
[gray]# or[/gray]
[ -d "$1" ] && echo "exist"

Feherke.
 
if you do a mkdir -p /path/name/of/dir on the remote server, the dir would be created if it does not already exist - the command would just silently do nothing if the dir already exists...




HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top