Sponsored Content
Full Discussion: CENTOS - istat
Operating Systems Linux Red Hat CENTOS - istat Post 302925361 by derekludwig on Sunday 16th of November 2014 07:44:33 PM
Old 11-16-2014
Many scripting languages can give you the information that istat provides, but I am not sure why you need to save the information to two new files ... but it is your script. For a perl replacement:
Code:
use strict;
use warnings;

use File::Basename;
use POSIX qw{ strftime };

$, = '';
$\ = "\n";

my $NAME = basename $0;

unless (0 < @ARGV) {
    print STDERR 'Usage: ', $NAME, ' <file> <mtimefile> <ownerfile>';
    exit 1;
}

my $file = shift @ARGV;
my @F = stat $file;

unless (0 < @F) {
    print STDERR $file, ': no such file or directory';
    exit 1;
}

$file = shift @ARGV;

open FH, '>', $file or die $file;
print FH strftime '%Y%m%d%H%M', localtime $F[9];
close FH;

$file = shift @ARGV;
open FH, '>', $file or die $file;
print FH $F[4], '(', scalar getpwuid($F[4]), ')';
close FH;

exit 0;

Which give you:
Code:
$ perl istatinfo istatinfo mtime owner
$ cat mtime
201411161938
$ cat owner
1002(derek)

for the file:
Code:
$ ls -l istatinfo
-rw-r--r--. 1 derek ludwig 588 Nov 16 19:38 istatinfo

Please format the mtime and owner to your liking.

Last edited by derekludwig; 11-16-2014 at 08:45 PM.. Reason: typo
 

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

HP LC2000 has message: istat=0a: LSS_PAR on ha=1 sist0=41

I have a HP Netserver 2000 running SCO UNIX 5.0.6. I get the message: istat=0a: LSS_PAR on ha=1 sist0=41 sist1=00 !!!! dstat =81 on ha=1 has DS_OPC while WAIT DISCONNECT, rp=c014f8co dsp=FD on path=1, newdsp=FD064600 WARNING: Parity Error MSG OUT=00000006 Failed, 1code=80000002 on ha=1 id... (0 Replies)
Discussion started by: dmksh
0 Replies

2. UNIX for Advanced & Expert Users

istat ??

I got the command : istat filename shows all the file details like owner and group name. But i want to know, who has accessed the file last time. As istat shows the name of owner of that file and name of the group. istat does lots of my work but i want to know who has accessed my file... (0 Replies)
Discussion started by: varungupta
0 Replies

3. UNIX for Advanced & Expert Users

istat ??

I got the command : istat filename shows all the file details like owner and group name. But i want to know, who has accessed the file last time. As istat shows the name of owner of that file and name of the group. istat does lots of my work but i want to know who has accessed my file... (2 Replies)
Discussion started by: varungupta
2 Replies

4. Shell Programming and Scripting

reformat date from istat

I would like to determine if a file is older than a particular date. I found that istat will let me see the date and time of a file older than a year, but I need to change the format. Could anyone help me reformat the following date to a variable (a one liner would be great). Output from istat -... (1 Reply)
Discussion started by: oldman2
1 Replies

5. Red Hat

How to Upgrade Centos 5.7 using Centos 5.8 ISO image on Vmware workstation

Dear Linux Experts, On my windows 7 desktop with the help of Vmware workstation (Version 7.1), created virtual machine and installed Centos 5.7 successfully using ISO image. Query : Is this possible to upgrade the Centos 5.7 using Centos 5.8 ISO image to Centos version 5.8?.. if yes kindly... (2 Replies)
Discussion started by: Ananthcn
2 Replies

6. Red Hat

RH V Centos

Hi, I have built out a new virtual production environment (VMWare, HA enabled, VMotion... all the bells & whistles) using RHEL5 VM's. I have got another ESX host that I plan to use as a pre-prod environment. To save some costs on RH subs I was thinking about installing this environment... (5 Replies)
Discussion started by: Duffs22
5 Replies
plucker-prc-install(1)					      General Commands Manual					    plucker-prc-install(1)

NAME
plucker-prc-install - fetch and install Plucker viewer application on a Palm pilot SYNOPSIS
plucker-prc-install [options] DESCRIPTION
This manual page documents briefly the plucker-prc-install command. This manual page was written for the Debian distribution because this program was created for the Debian package. plucker-prc-install is a program that fetches and installs the Plucker viewer application. The program uses wget to get the .tar.bz2 archive from the Web. You need to be connected to the Internet and have wget working correctly in order to use this program. You may have to configure the environment variable http_proxy. You can take a look at the lynx command manpage to get information about http_proxy. The program tries to use the correct language version of the viewer according to the environment variable LANG. The program then uses either gpilot-install-file or pilot-xfer to transfer the three .prc files to the Palm pilot. With pilot-link 0.12.x it is mandatory to provide a port to use. plucker-prc-install first use the value of the PILOTPORT environment variable. If PILOTPORT is not defined it uses /dev/pilot. If the file /dev/pilot does not exist it uses usb:. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --nohires installs the low-resolution version of the Plucker viewer. If you are using a Palm with a 160x160 screen (Palm m500-series and ear- lier) you can save approximately 90 KB by installing the low-resolution version of the viewer. Note that the hires version will still work on older Palms, but will just take up unnecessary space. -h, --help Show summary of options. -v, --version Show version of program. SEE ALSO
pilot-xfer(1), wget(1), gpilot-install-file(1), lynx(1). AUTHOR
This manual page was written by Ludovic Rousseau <rousseau@debian.org>, for the Debian GNU/Linux system (but may be used by others). August 22, 2005 plucker-prc-install(1)
All times are GMT -4. The time now is 11:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy