Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Shell script: last modification date for a file Post 302078886 by onlyc on Wednesday 5th of July 2006 08:05:05 AM
Old 07-05-2006
last modification date

What i have done is: accepted user input and done validation to check if the file is a valid one.
But i cant retrieve the last modification date...


I have tried using :
ls -l , put it into a file and then used cut command to display the date... but the cut command is not working!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

command for modification date of a file

Good morning, I would like to find all files of a certain type and display their name as well as their modification date. In order to do this, I would do the following: find ./ -name *.csv | ???????? My question: what to put after the pipe instead of the question marks? Is there a basic... (5 Replies)
Discussion started by: scampsd
5 Replies

2. UNIX for Dummies Questions & Answers

File comparision and modification using shell script

Hello everyone, I would like to know how to compare two files and modify any differences with some other data using shell script. I think it would be better understood with an example. I got two files named 'filex' and filey'. 'filex' is constant file without any changes in data. 'filey' is... (2 Replies)
Discussion started by: maddy81
2 Replies

3. Shell Programming and Scripting

List the file or files with last modification date

hi. I need help my programing friends :p I need to list all the files with a certain name (for example FileName) by last modification date but only the one with the last date. If there are two files with the same name and same modification date it should print the both. For example in this set... (6 Replies)
Discussion started by: KitFisto
6 Replies

4. Shell Programming and Scripting

Help with Shell Script Modification

Hi all Iam very new to Shell Scripting, I have to modify a shell script looking at an existing one except that it will query against some table X in A database. Befor Spooling check if there are any reload files if there archive the files. The above scipt executes some abc.sql which will b a new... (2 Replies)
Discussion started by: Varunkv
2 Replies

5. Homework & Coursework Questions

How do I get at the modification date for a file as a variable for a script?

I realize this is basic and probably obvious, but I'm pulling my hair out. I'm guessing this is just some flag on the file command or somesuch, but I can't find it. Help me get unstuck please? EDIT: I guess what I'm asking is once I've got the ls -l output for a file, what command do I use to... (3 Replies)
Discussion started by: Timespike
3 Replies

6. OS X (Apple)

get file modification date in number format (yyyy mm dd hh mm ss)

How do i get the file modification date in number format (yyyy mm dd hh mm ss) i used ls -l pathname but month is still in text "Aug" and year and time is not allways shown. time is show if it is in this year. and year is shown if it is before this year. what do i need to get... (7 Replies)
Discussion started by: rvdokkum
7 Replies

7. Shell Programming and Scripting

Needed shell script to read txt file and do some modification

Hi ...programmers... I need a shell script to perform some specific task.. my txt file looks like this netcdf new { dimensions: XAX1_11 = 11 ; variables: double XAX1_11(XAX1_11) ; XAX1_11:point_spacing = "even" ; XAX1_11:axis = "X" ; float DEPTH(XAX1_11) ;... (19 Replies)
Discussion started by: Akshay Hegde
19 Replies

8. UNIX for Dummies Questions & Answers

How do you get the last modification date of a file?

I'm trying to get the date output to be in the form yyyy-mm-dd (e.g. 2013-01-18) !/bin/sh modDate=$(stat -c %y $1) echo $modDate >> $1 When I run this on another file (by typing ./dateScript theFile.txt), I keep getting this message: stat: illegal option -- c What's wrong with my code... (2 Replies)
Discussion started by: Nate18
2 Replies

9. Programming

File date/time modification and permissions

First, oh great Unix gurus, forgive if this is a stupid question. Unix/Linux is not my main thing but I have been programming in C/C++ for many years. I will do my best to be specific. I have a program in C/C++ that needs to modify the time of a given file. Currently I do this using utime()... (5 Replies)
Discussion started by: Pug
5 Replies

10. Shell Programming and Scripting

Subtract a file's modification date with current date

SunOS -s 5.10 Generic_147440-04 sun4u sparc SUNW,SPARC-Enterprise Hi, In a folder, there are files. I have a script which reads the current date and subtract the modification date of each file. How do I achieve this? Regards, Joe (2 Replies)
Discussion started by: roshanbi
2 Replies
XStoreBytes(3X11)						     MIT X11R4							 XStoreBytes(3X11)

Name
       XStoreBytes, XStoreBuffer, XFetchBytes, XFetchBuffer, XRotateBuffers - manipulate cut and paste buffers

Syntax
       XStoreBytes(display, bytes, nbytes)
	  Display *display;
	  char *bytes;
	  int nbytes;

       XStoreBuffer(display, bytes, nbytes, buffer)
	  Display *display;
	  char *bytes;
	  int nbytes;
	  int buffer;

       char *XFetchBytes(display, nbytes_return)
	  Display *display;
	  int *nbytes_return;

       char *XFetchBuffer(display, nbytes_return, buffer)
	  Display *display;
	  int *nbytes_return;
	  int buffer;

       XRotateBuffers(display, rotate)
	  Display *display;
	  int rotate;

Arguments
       buffer	 Specifies the buffer in which you want to store the bytes or from which you want the stored data returned.

       bytes	 Specifies the bytes, which are not necessarily ASCII or null-terminated.

       display	 Specifies the connection to the X server.

       nbytes	 Specifies the number of bytes to be stored.

       nbytes_return
		 Returns the number of bytes in the buffer.

       rotate	 Specifies how much to rotate the cut buffers.

Description
       Note that the cut buffer's contents need not be text, so zero bytes are not special.  The cut buffer's contents can be retrieved later by
       any client calling

       can generate a error.

       If the property for the buffer has never been created, a error results.

       can generate and errors.

       The function returns the number of bytes in the nbytes_return argument, if the buffer contains data.  Otherwise, the function returns NULL
       and sets nbytes to 0.  The appropriate amount of storage is allocated and the pointer returned.	The client must free this storage when
       finished with it by calling Note that the cut buffer does not necessarily contain text, so it may contain embedded zero bytes and may not
       terminate with a null byte.

       The function returns zero to the nbytes_return argument if there is no data in the buffer.

       can generate a error.

       The function rotates the cut buffers, such that buffer 0 becomes buffer n, buffer 1 becomes n + 1 mod 8, and so on.  This cut buffer num-
       bering is global to the display.  Note that generates errors if any of the eight buffers have not been created.

       can generate a error.

Diagnostics
       The server failed to allocate the requested resource or server memory.

       A value for an Atom argument does not name a defined Atom.

       Some argument or pair of arguments has the correct type and range but fails
		 to match in some other way required by the request.

       Some numeric value falls outside the range of values accepted by the request.
		 Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument
		 defined as a set of alternatives can generate this error.

See Also
       XFree(3X11)
       X Window System: The Complete Reference, Second Edition, Robert W. Scheifler and James Gettys

																 XStoreBytes(3X11)
All times are GMT -4. The time now is 12:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy