Sponsored Content
Top Forums Shell Programming and Scripting Files with date and time stamp Post 302856815 by jayadanabalan on Tuesday 24th of September 2013 10:36:26 PM
Old 09-24-2013
Hi Folks,

To use this command mv "$file" "${file/./_first.}" i need to assign the file name to file variable first right ?

I am in the process of automating the step and I will not know what time the file will be created and it can be at anytime of the day. In this case how do i change the name of the file?

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File date and time stamp

I have to capture the creation date and time stamp for a file. The ls command doesn't list all the required information. I need year, month, day, hour, minute and second. Any ideas... (1 Reply)
Discussion started by: Xenon
1 Replies

2. Shell Programming and Scripting

Date Time Stamp

I'm trying to write a script that checks the DTS of a file the compares it to the current time. If greater that 60 mins has gone by and the file has not been written to alert. So far I have the time pulled from the file but I dont know how to compare the times against a 60 min difference. ... (2 Replies)
Discussion started by: jarich
2 Replies

3. Shell Programming and Scripting

Insert Time and Date Stamp

I have a directory with following files in it ABC.000.DAT ABC.001.DAT ABC.002.DAT ABC.003.DAT I want to insert time and date stamp in file names like ABC.000.YYYYMMDDHHMM.DAT I able to insert the time and date stamp at the end of filename Kindly help (1 Reply)
Discussion started by: aajmani
1 Replies

4. UNIX for Dummies Questions & Answers

Date/Time Stamp

Hi All, Wondering if there is have a date added at the end of a test string. I have a hypothetical text file day one: John Paul George When the file day one is output, I'd like it to read something like this: John 101406 Paul 101406 George 101406 Day two, when the same text file... (0 Replies)
Discussion started by: JimmyFlip
0 Replies

5. UNIX for Dummies Questions & Answers

How to Zip the files from date Stamp to end date Stamp

Hi, I need to zip the list of files using from date Stamp to end date Stamp, How can I filter and make FromDate_EndDate.gzip? any idea? (1 Reply)
Discussion started by: redlotus72
1 Replies

6. UNIX for Advanced & Expert Users

rsync - date/time stamp

Hi, We are using RSYNC for syncing remote directories and working great. Our requirement is to have the destination files with date/time stamp of when they're copied on to the destination server, NOT the date/time stamps of source files/directories. As RSYNC, by default, preserving the same... (4 Replies)
Discussion started by: prvnrk
4 Replies

7. Linux

rename files in a folder with date&time stamp

Hi, I want to rename all the files (more than 100 files) in a fodler to another folder with date&time stamp. foe eg, file1.dat file2.dat file3.dat .. to be renamed as file1100629_16_30_15.txt (yy-mon-dd_hh_mi_ss) file1100629_16_30_16.txt .. so on (2 Replies)
Discussion started by: feroz
2 Replies

8. Shell Programming and Scripting

Set date and time stamp of one file to another

Hi I use "touch -t xxxxxxxx" command to set date/time stamp of a file. My requirement is to read the date/time stamp of a file and apply it to another file. Is there anyway to do it simple instead of manually taking date/stamp of first file? TIA Prvn (2 Replies)
Discussion started by: prvnrk
2 Replies

9. Emergency UNIX and Linux Support

Is there any way to set the files modified date and stamp to last modifies time?

Actually i did modification in a file on server by mistake, now its showing current time stamp, is there any way to set the files modified date and stamp to last modifies time. Please advice here.Thanks in advance.:b: (7 Replies)
Discussion started by: saluja.deepak
7 Replies

10. Emergency UNIX and Linux Support

How to append date and time stamp before the two extensions?

hi, i have some file names. my file names are as follows: c_abc_new.txt.xls c_def.txt.xls i want to append date time stamp in the below manner. c_abc_new_YYYYMMDD_HH24MISS.txt.xls c_def_YYYYMMDD_HH24MISS.txt.xls check the two input file names, they differ in naming. the 1st file name... (9 Replies)
Discussion started by: Little
9 Replies
XSetInputFocus()														  XSetInputFocus()

Name
  XSetInputFocus - set the keyboard focus window.

Synopsis
  XSetInputFocus(display, focus, revert_to, time)
	Display *display;
	Window focus;
	int revert_to;
	Time time;

Arguments
  display  Specifies a connection to an X server; returned from XOpenDisplay().

  focus    Specifies the ID of the window you want to be the keyboard focus.  Pass the window ID, PointerRoot, or None.

  revert_to
	   Specifies  which  window  the  keyboard  focus  reverts to if the focus window becomes not viewable.  Pass one of these constants:
	   RevertToParent, RevertToPointerRoot, or RevertToNone.  Must not be a window ID.

  time	   Specifies the time when the focus change should take place.	Pass either a timestamp, expressed in milliseconds, or	the  constant
	   CurrentTime.  Also returns the time of the focus change when CurrentTime is specified.

Description
  XSetInputFocus() changes the keyboard focus and the last-focus-change time.  The function has no effect if time is earlier than the current
  last-focus-change time or later than the current X server time.  Otherwise, the last-focus-change time is set to the specified  time,  with
  CurrentTime replaced by the current X server time.

  XSetInputFocus() generates FocusIn and FocusOut events if focus is different from the current focus.

  XSetInputFocus() executes as follows, depending on what value you assign to the focus argument:

  o  If you assign None, all keyboard events are discarded until you set a new focus window.  In this case, revert_to is ignored.

  o  If  you  assign  a  window ID, it becomes the main keyboard's focus window.  If a generated keyboard event would normally be reported to
     this window or one of its inferiors, the event is reported normally; otherwise, the event is reported to the focus window.   The  speci-
     fied  focus window must be viewable at the time of the request (else a BadMatch error).  If the focus window later becomes not viewable,
     the focus window will change to the revert_to argument.

  o  If you assign PointerRoot, the focus window is dynamically taken to be the root window of whatever screen the pointer is on at each key-
     board event.  In this case, revert_to is ignored.	This is the default keyboard focus setting.

  If the focus window later becomes not viewable, XSetInputFocus() evaluates the revert_to argument to determine the new focus window:

  o  If  you  assign  RevertToParent,  the  focus reverts to the parent (or the closest viewable ancestor) automatically with a new revert_to
     argument of RevertToName.

  o  If you assign RevertToPointerRoot or RevertToNone, the focus reverts to that value automatically.	FocusIn and FocusOut events are  gen-
     erated when the focus reverts, but the last focus change time is not affected.

Errors
  BadMatch  focus window not viewable when XSetInputFocus() called.

  BadValue

  BadWindow

See Also
  XQLength(),	XAllowEvents(),   XCheckIfEvent(),   XCheckMaskEvent(),  XCheckTypedEvent(),  XCheckTypedWindowEvent(),  XCheckWindowEvent(),
  XEventsQueued(), XGetInputFocus(), XGetMotionEvents(), XIfEvent(), XMaskEvent(), XNextEvent(),  XPeekEvent(),  XPeekIfEvent(),  XPending(),
  XPutBackEvent(), XSelectInput(), XSendEvent(), XSynchronize(), XWindowEvent().

Xlib - Input Handling														  XSetInputFocus()
All times are GMT -4. The time now is 02:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy