The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-08-2007
Registered User
 

Join Date: Jan 2007
Posts: 2
help with ! -d and -p

Hi,

I am new to UNIX programming i want to understand a simple thing.
Please help me out in deciphering the UNIX commands mentioned below.


All I need to understand is the meaning of -p & !-d in the second line.

I can easily get the meaning of special commands but can not understand what is -p & !-d in the second line.

The purpose of this command is to copy 1 file from 1 environment to another.


ksc_connect_dest_client
if [!-d [P.P_SUB_PATH]]; then mkdir -p [P.P_SUB_PATH]; fi
ksc_exit
ksc_copy_cliet_client SUB_PATH="[P.P_SUB_PATH]"FILENAME="[P.P_FILENAME]"
FILE_TYPE=[P.P FILE_TYPE]"

ksc_connect_dest_client
This command initiates a TELNET, SSH, or SSH2 session with the client of
the destination environment.

ksc_copy_client_client
This command copies a file from the source client environment to the
destination client environment.


ksc_exit
This command exits the TELNET, SSH, or SSH2 session initiated


[P.P_SUB_PATH]
The sub-directory that should be used to locate the file relative to the base path of each
environment


[P.P_FILE_TYPE]
Variable for that particular file type


[P.P_FILENAME]
Variable for that particular file name


please help me with this, i need urgent solution for this.

thanks.

Himanshu

Last edited by vino; 01-08-2007 at 07:36 AM. Reason: remove email address
Reply With Quote
Forum Sponsor
  #2  
Old 01-08-2007
_Spare_Ribs_'s Avatar
Registered User
 

Join Date: Dec 2006
Location: /dev/null
Posts: 72
Hi,

Firstly you need to remove your e-mail address from the bottom of your posts. The information that is posted on this forum is for the benefit of everyone and therefore replies shouldn't be e-mailed.

As for your questions.

mkdir -p ~ This will print no error message if the directory already exists and will make any parent directories if required.

!-d ~ This will test to see if the directory does NOT exist in the statement.

So what the second line of your code is doing essientially is seeing if a directory doesn't exist. If it doesn't then it creates the directory.

Hope this helps.
Reply With Quote
  #3  
Old 01-08-2007
Registered User
 

Join Date: Jan 2007
Posts: 2
Thank You

Thank You very much for your response _Spare_Ribs_ ,
I am sorry for posting my email id, i now have clear idea about the commands.


Himanshu
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0