The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 04-23-2009
mrlayance mrlayance is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 20
Quote:
Originally Posted by vgersh99 View Post
Code:
#!/bin/bash
file='file.txt'
while read inter time
do
   printf "%s %s\n" "${inter}" "$(perl -e 'print scalar localtime("${time}") . "\n";')"
done < "${file}

Hmm, different issue now? The $time variable is not being passed for some reason.

Code:
Fa1/14 Wed Dec 31 20:00:00 1969
Fa1/11 Wed Dec 31 20:00:00 1969
Se0/0/0 Wed Dec 31 20:00:00 1969
Fa1/9 Wed Dec 31 20:00:00 1969
Fa1/0 Wed Dec 31 20:00:00 1969
Fa1/3 Wed Dec 31 20:00:00 1969
Fa0/0 Wed Dec 31 20:00:00 1969
Gi1/0 Wed Dec 31 20:00:00 1969
Se0/0/1 Wed Dec 31 20:00:00 1969
Fa1/8 Wed Dec 31 20:00:00 1969
Fa1/15 Wed Dec 31 20:00:00 1969
Fa1/13 Wed Dec 31 20:00:00 1969
Fa1/10 Wed Dec 31 20:00:00 1969
Fa1/12 Wed Dec 31 20:00:00 1969
Fa1/1 Wed Dec 31 20:00:00 1969
Fa0/1 Wed Dec 31 20:00:00 1969
Fa1/6 Wed Dec 31 20:00:00 1969
Fa1/5 Wed Dec 31 20:00:00 1969
Se0/0/0.1 Wed Dec 31 20:00:00 1969
Fa1/7 Wed Dec 31 20:00:00 1969
Fa1/2 Wed Dec 31 20:00:00 1969
Lo0 Wed Dec 31 20:00:00 1969
Fa1/4 Wed Dec 31 20:00:00 1969