Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:18:10+00:00 2026-06-07T15:18:10+00:00

Hello i am using hp unix, i am trying to loop through the last

  • 0

Hello i am using hp unix, i am trying to loop through the last 20 days (with respect to the current date) using a for loop .

for (( c=1; c<=5; c++ ))
do
day$c=$(perl -e 'use POSIX;print strftime "%Y%m%d\n",localtime time-86400*$c;')
done
later do some operations with day$c

issue is that for some strange reason 86400*$c is not executing , can any one point out the mistake ? thanks in advance .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:18:12+00:00Added an answer on June 7, 2026 at 3:18 pm

    Try different quoting:

    day$c=$(perl -e "use POSIX;print strftime qq(%Y%m%d\n),localtime time-86400*$c;")
    

    (I’m not familiar with HPUX, but it looks like $c isn’t getting interpolated by the shell.)

    Edit: Or the slightly shorter:

    day$c=$(perl -MPOSIX -le "print strftime '%Y%m%d',localtime time-86400*$c;")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I installed cygwin on Windows XP so I can use Unix command in
I'm just trying to compile the hello world example of boost.python WITHOUT using all
I am trying to run a simple loop through all files script but it's
I'm trying to build a hello world using GTK, which includes the line: #include
Hello Im using SQL2000 so I build a Dynamic Query and in the last
Hello im using page nation which is amazing but now im trying to print
I have a class: class MyClass(object): @property def myproperty(self): return 'hello' Using mox and
Hello Im using HTTParty to call for a remote json file that I need
Hello i'm using map() jquery to create a new object array DEMO but this
Hello i am using SocializeActionBar for my app there i have multiple links. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.