I'm trying to rename the last generated file in a given directory using a makefile.
If I type 'make build' the 'build' target produces a file (ie: text_001.txt). It automatically generates them sequentially, so I don't have control over the name. I can't say that it will always be text_001.txt.... (2 Replies)
Hi,
Can anyone plz share their experience with -
Building shell script to append the file with date in following format-
Filename_MMDDYYYY.txt
Thanks in advance (2 Replies)
Hi I am very new to scripting,
Can someone show me how to (in unix shell script) compare the system's date with a date in a file. The requirement is to somehow open this file (which will only have a date in it) and compare it with today's date. If they are equal execute a procedure below but if... (4 Replies)
I am a newbie to scripting.
I need a korn shell script to copy log files of current day to archive folder and rename with current days date stamp.
I would really appreciate your help.
File structure is as follows. Everyday files get overwritten, so I need copy to a archive directory and... (3 Replies)
Hi Guys,
I was working some time ago n was in need to calculate date 30/31 days from today including Feb (Leap yr stuff). Today date is variable depending on day of execution of script. I tried searching but was not able to get exactly what I needed....So at that I time I implemented by my own... (3 Replies)
I would like to find the Files which are generated today in the current directory:
I use the commad ls -lrt * | egrep " `date "+%b"` * `date "+%d"`
to acheive this. Is there any better way to acquire the same.
Multiple answers will be great. Thanks (3 Replies)
Hi
I have file with number status and date1 and date1 field,
want add a column today between column date1 and date2.
file1.txt
number status date1 date2
===== ==== === =====
34567 open 27/06/13 28/06/13
45678 open 27/06/13 28/06/13
43567 open 27/06/13 28/06/13 ... (1 Reply)
This is on a CentOS box, I have two scripts that need to run in order.
I want to write a shell script that calls the first script, lets it run and then terminates it after a certain number of hours (that I specify of course), and then calls the second script (they can't run simultaneously) which... (3 Replies)
Hi Community!
Following on from this code in another thread:
#!/bin/bash
file_string=`/bin/cat date.txt | /usr/bin/awk '{print $5,$4,$7,$6,$8}'`
file_date=`/bin/date -d "$file_string"`
file_epoch=`/bin/date -d "$file_string" +%s`
now_epoch=`/bin/date +%s`
if
then
#let... (2 Replies)
Discussion started by: Greenage
2 Replies
LEARN ABOUT DEBIAN
explain_rename_or_die
explain_rename_or_die(3) Library Functions Manual explain_rename_or_die(3)NAME
explain_rename_or_die - change the name of a file and report errors
SYNOPSIS
#include <libexplain/rename.h>
void explain_rename_or_die(const char *oldpath, const char *newpath);
DESCRIPTION
The explain_rename_or_die function is used to call the rename(2) system call. On failure an explanation will be printed to stderr,
obtained from explain_rename(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_rename_or_die(oldpath, newpath);
oldpath The oldpath, exactly as to be passed to the rename(2) system call.
newpath The newpath, exactly as to be passed to the rename(2) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO rename(2)
change the name or location of a file
explain_rename(3)
explain rename(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_rename_or_die(3)