user1766760
user1766760

Reputation: 631

Why does strftime uppercase flag '^' not work?

I have the following command $(perl -e 'use POSIX;print strftime "%d-%^b-%Y",localtime time-86400;') which works on Red Hat Linux box, but not on a Sun Solaris 9 box.

Question 1: From what I read here, '^' is provided by glibc... is this correct?

Question 2: How do I find out why it's not working on the Solaris box? (And ultimately, how do I make it work?)

Upvotes: 0

Views: 258

Answers (1)

perl_advocate
perl_advocate

Reputation: 160

Solaris is not Linux, Although it's Unix :-), System calls behave differently on different system, that's why you will see lots of #ifdef in C programs. You can compile this C example of some time functions on RedHat and Solaris and see the difference (convert %B to %^B and you will see that it will not print in uppercase). The best solution is to use Perl's uc function.

Upvotes: 6

Related Questions