![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|||
| Google The UNIX and Linux Forums |