Sponsored Content
Full Discussion: compatibility problem ??!!
Top Forums Shell Programming and Scripting compatibility problem ??!! Post 21420 by oti on Thursday 16th of May 2002 08:57:05 AM
Old 05-16-2002
Question compatibility problem ??!!

hi!

i have two problems with the following script who prepares a date (removes the heading zero from day if day<10) for arithmetical operations:

<script>
#!/usr/bin/sh

DAY=`date +%d`;
echo 1 - $DAY;#i.e. 06
DAY=${DAY#0};
echo 2 - $DAY;#i.e. 6
</script>

1. every time i run this script on SunOS 5.7 (SPARC) i get a 'bad substitution' error (only) if the first line isn't blank
2. every time i run this script on SunOS 5.6 (SPARC) i get a 'bad substitution' error (no matter if the first line in blank or not)

thanks
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Motherboard Compatibility

Hi there,, I URGENTLY need to know if the Gigabyte GA 8IDML Motherboard is compatible with the Unix BSD. We need to know if we should buy new boards before we can use the product. Thanking you Hannelie Bosch:confused: :confused: (1 Reply)
Discussion started by: hbosch
1 Replies

2. Filesystems, Disks and Memory

Program Compatibility

I really Hate the Monopoly Microsoft has over Software, but the fact remains it exists... so I wonder if there was a way to enable Programs Made for Windows and Mac to be Run in Unix as if it was in the Specified OS. Like a Compatibility Wizard. Or in a dual boot computer, for Unix to be able to... (4 Replies)
Discussion started by: Elliandr
4 Replies

3. Solaris

Disks compatibility

Hi all, I am trying to isntall veritas replicator on 2 DA 3000 storage , But with little luck . I am running a solaris 10 and vsf 4.1, Veritas Volume Replicator Option 4.1 My question is that : when i got the array i had 2 disks missing , So we had to replace them , but I found out that... (0 Replies)
Discussion started by: ppass
0 Replies

4. HP-UX

About compatibility of HP-UX 11i

Could you please tell me if Informix 7.20 UD2 works on HP-UX 11i and if applications that works on HP-UX 10.20 and Informix 7.20 UD2 works on HP-UX 11i. Thanks a lot. (0 Replies)
Discussion started by: Irene Martínez
0 Replies

5. Shell Programming and Scripting

Compatibility problem of Tk Module in different versions

Hi, I am using Tk module in perl 5.6 and it is working fine. Now when i installed the newer version 5.10.0 then getting error that Tk module not found. But i will have to work on this newer verison only to use some other modules of perl. I want to know why Tk module is not working in newer... (6 Replies)
Discussion started by: kunal_dixit
6 Replies

6. HP-UX

LTO Compatibility

Is any one told me that LTO3 tape Cartridge is compatible with LTO2 Tape Drive. (2 Replies)
Discussion started by: Shawn Paul
2 Replies

7. SCO

SCO unix binary compatibility problem

Hi I am looking for sco xenix binary compatibility utility "cvtomf",(convert omf object to COFF object) Would you please help me ? tnx (3 Replies)
Discussion started by: javad1_maroofi
3 Replies

8. Solaris

Solaris 10 - HW compatibility

Sorry, if this isn't the right forum for this question. I would like to compile an executable with gcc/g++ under Solaris 10 on the following OLDER SPARC-machine and then run this executable on the NEW SPARC-machine (see description down in this post). I'm wondering if it would be possible or if... (4 Replies)
Discussion started by: sunfire
4 Replies

9. UNIX for Dummies Questions & Answers

Compatibility between UNIXes

Will a program or application that runs in one UNIX run in any UNIX? Shouldn't they? Why not? What are the constraints? What keeps OpenOffice for Solaris from working on a HP-UX box? Wouldn't life be simpler (and thus more eficient) if all UNIXes were «a UNIX» instead of manufacturers' vault? (2 Replies)
Discussion started by: spitzer
2 Replies

10. Shell Programming and Scripting

Linux Compatibility

Hi all. I'm in the process of migrating existing script on UNIX server to the LINUX platform. One of the script that have issues is this one: cd /home/edwh_test/S13018/EDWH-DMT03/stgdata/RPT/ # GIANT # rm -f INPUT_GIANT.csv filename=INPUT_GIANT_*csv GIANT_MONYYYY=$(echo $filename | awk... (9 Replies)
Discussion started by: aimy
9 Replies
DATETIME.SETDATE(3)							 1						       DATETIME.SETDATE(3)

DateTime::setDate - Sets the date

       Object oriented style

SYNOPSIS
public DateTime DateTime::setDate (int $year, int $month, int $day) DESCRIPTION
Procedural style DateTime date_date_set (DateTime $object, int $year, int $month, int $day) Resets the current date of the DateTime object to a different date. PARAMETERS
o $object -Procedural style only: A DateTime object returned by date_create(3). The function modifies this object. o $year - Year of the date. o $month - Month of the date. o $day - Day of the date. RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | Changed the return value on success from NULL to | | | DateTime. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 DateTime.setDate(3) example Object oriented style <?php $date = new DateTime(); $date->setDate(2001, 2, 3); echo $date->format('Y-m-d'); ?> Procedural style <?php $date = date_create(); date_date_set($date, 2001, 2, 3); echo date_format($date, 'Y-m-d'); ?> The above examples will output: 2001-02-03 Example #2 Values exceeding ranges are added to their parent values <?php $date = new DateTime(); $date->setDate(2001, 2, 28); echo $date->format('Y-m-d') . " "; $date->setDate(2001, 2, 29); echo $date->format('Y-m-d') . " "; $date->setDate(2001, 14, 3); echo $date->format('Y-m-d') . " "; ?> The above example will output: 2001-02-28 2001-03-01 2002-02-03 SEE ALSO
DateTime.setISODate(3), DateTime.setTime(3). PHP Documentation Group DATETIME.SETDATE(3)
All times are GMT -4. The time now is 05:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy