Pin code counter


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pin code counter
# 1  
Old 05-29-2015
Pin code counter

hello i wanted to see if anyone can analyze the following code and see where the error lies. it is supposed to echo the current date and start counting from 0000-9999 and show the approximate range that it is at. here is a pic of what the output should look like:
Image

here is the scrpit:

Code:
#/bin/bash
while true do
  clear echo
  date start=`date +%s -d "Wed Jan 16 17:46:00"`
  current=`date +%s`
  echo "Current PIN Between: " | tr '\n' ' '
  echo "($current - $start) / 19.782" | bc | tr '\n' ' '
  echo " and " | tr '\n' ' '
  echo "($current - $start) / 18.782" | bc
  sleep 2
done

thanx in advance.
# 2  
Old 05-29-2015
Is this a homework assignment?

What operating system are you using?

Do you have access to a 1993 or later version of the Korn shell (ksh)?

What diagnostics did you get from bash when you tried running your script? Did those diagnostics give you any idea of what errors might be present in your script?
# 3  
Old 05-30-2015
Yes it's a class project.

We are using windows but I have Linux at home.

Sorry totally new to this. I don't know what ksh is.

When I run the script all I get is unexcepted ending ( if I remember correct) and it says something about the done on the last line of the code.

Sorry I can't help more. This is the first assignment of the class. If you want to copy the script and run it yourself it's fine by me.
# 4  
Old 05-30-2015
We are not here to do your homework for you. Homework has to be filed in the homework & coursework questions forum and the homework template included in the homework and coursework forum rules must be filled in completely for all posts in that forum.

Moderator's Comments:
Mod Comment This thread is closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. AIX

Pin Memory Statistics

Hi, We have an issue on our lpar where the pin memory usage slowly and regularly increases approx 1.5% a day until it reaches its 80% threshold We have to regularly reboot the lpars to release the pin memory as we have found that killing all processes does not release it. However,... (1 Reply)
Discussion started by: GarciasMuffin
1 Replies

2. Programming

Need pin generation code

Hi Can any one tell me from where can i get the code/library(c/c++(Sun)) for PIN generation. Actually i need to generate a new PIN for the user in case sombody reset his PIN. Thanks in Advance. (1 Reply)
Discussion started by: unisuraj
1 Replies

3. UNIX Desktop Questions & Answers

Pin to desktop

Hello everybody! I need some help. Is there a way to pin a window to the desktop in Linux? I have a list of tasks in Calc. And I want the window of Calc to be always before my eyes, so that it sort of reminds me of my tasks. The window must be «stuck» to the desktop, and when I click the... (0 Replies)
Discussion started by: alex777
0 Replies

4. Shell Programming and Scripting

how to pin files to /tmp

Hi all, Am currently working on editing a startup script that need me to copy a certain file from cdrom to /tmp (its a live cd am working on)and mount if from there to certain place.. Now i know that nothing can be stored in /tmp permanently ,however mechanism to load the file to /tmp on... (19 Replies)
Discussion started by: wrapster
19 Replies

5. Programming

How to set the DSR pin using a C Code

Hi, I am a newbie using linux. I want to use the 9 pins of the COM port for data transmission. I am trying to write a code to toggle the DTR pin in /dev/ttyS0. Can any one help by giving a sample code or links that will help me pick up fast Regards (2 Replies)
Discussion started by: Srikanthks_2000
2 Replies
Login or Register to Ask a Question