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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cannot get logic for concatenation awk user_prady Shell Programming and Scripting 7 12-10-2007 03:09 AM
File Concatenation samit_9999 UNIX for Dummies Questions & Answers 3 11-21-2006 06:26 AM
string concatenation systemsb UNIX for Dummies Questions & Answers 7 04-04-2006 01:03 PM
Implementing Concatenation(cat) toughguy2handle High Level Programming 2 09-22-2005 03:10 AM
Concatenation videsh77 Shell Programming and Scripting 2 12-14-2004 06:13 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-04-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398

Code:
$year=$year+1900;
$DB_Date=sprintf("%02d%02d", $date, $Month);

  #2 (permalink)  
Old 04-04-2007
Asteroid Asteroid is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 38
But the output is same...

print $DB_Date ---> 0000

I see the following warning ..


Code:
Use of uninitialized value in sprintf at /dev/fd/4 line 9


Last edited by Asteroid; 04-04-2007 at 06:22 AM..
  #3 (permalink)  
Old 04-04-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398

Code:
#!/bin/perl -w
use IO::Handle;

($day, $month, $year) = (localtime)[3,4,5];


$month=$month+1;
$year=$year+1700;
$DB_Date=printf("%02d%02d", $date, $Month);

Use day instead of date.Variables are case sensitive.Change the case of month
  #4 (permalink)  
Old 04-04-2007
Asteroid Asteroid is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 38
THx man ,, It worked ,, ......

Your help was really appriciating..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0