This is a discussion on make directory within the Shell scripting forums, part of the Development/Scripting category; I am currently working on a PL file. where i encounter some errors. I am trying to create a dir ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
I am currently working on a PL file. where i encounter some errors.
I am trying to create a dir if it is not available : ######################## 22 FILEPATH = '/trs/wg/'.$ToDate.'/'; 23 print "Filepath is $FILEPATH\n"; 24 #CURDIR = $FILEPATH; 25 if [ ! -d $FILEPATH ]; 26 then 27 mkdir $FILEPATH 28 fi ######################## The error was : Can't modify constant item in scalar assignment at printfile.pl line 22, near "' /';" syntax error at printfile.pl line 25, near "if [" Semicolon seems to be missing at printfile.pl line 27. printfile.pl had compilation errors. Anyone can help me? |
| Sponsored Links | ||
|
|
|
||||
|
I'm not perl expert but it looks like you have mixed shell scripting with perl code.
Okay first try to replace line 22 Code:
22 FILEPATH = '/trs/wg/'.$ToDate.'/'; Code:
FILEPATH = "/trs/wg/".$ToDate."/"; Code:
25 if [ ! -d $FILEPATH ]; 26 then 27 mkdir $FILEPATH 28 fi Code:
if ( ! -d $FILEPATH ){
mkdir($FILEPATH, 0755) || die "Cannot mkdir newdir: $!";
}
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| make 2.6.22 as 2.6.18 image.. | sathiya | Ubuntu / Debian | 1 | 05-02-2008 02:03 AM |
| How to make leafpad to print | satimis | Linux software | 0 | 12-25-2007 07:36 PM |
| error while using make in aix | linuxnightowl84 | Coding in General | 0 | 04-18-2007 11:23 AM |
| How do I make an initrd image? | jerry | Linux software | 2 | 12-16-2005 07:32 PM |
| How do I make backup of ISO CD | sweta | Solaris/OpenSolaris | 1 | 09-09-2005 05:29 PM |