Sponsored Content
Full Discussion: file date vs. system date
Top Forums UNIX for Dummies Questions & Answers file date vs. system date Post 6736 by clemeot on Tuesday 11th of September 2001 06:54:41 AM
Old 09-11-2001
Computer

I know the symbols represents something like this:

| xargs = and execute arguments
and -exec = execute command

Patvdv, thank you very much!!!!!
Now i understand what is inode change.
Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare date from db2 table to yesterday's Unix system date

I am currently running the following Korn shell script which works fine: #!/usr/bin/ksh count=`db2 -x "select count(*) from schema.tablename"` echo "count" I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies

2. Shell Programming and Scripting

Set system date to some date (Sunos)

I am testing a script and need to change the system date to Nov 30 2009. I cannot seem to find a way to do this other than TZ command but it does not seem to work correctly. I tried TZ=GMT+168 date but it is returning todays date Mon Dec 7 19:48:11 GMT 2009 ...instead of Nov 30 2009 I... (4 Replies)
Discussion started by: hanton
4 Replies

3. Shell Programming and Scripting

how to get what date was 28 days ago of the current system date IN UNIX

Hi, Anybody knows how to get what date was 28 days ago of the current system date through UNIX script. Ex : - If today is 28th Mar 2010 then I have to delete the files which arrived on 1st Mar 2010, (15 Replies)
Discussion started by: kandi.reddy
15 Replies

4. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

5. UNIX for Dummies Questions & Answers

Comparing Output Date to Current System Date

Hi Guys, Anyone who knows how to compare the current date with the a file containing a date, say for example I have a file that looks like this: Command was launched from partition 0. ------------------------------------------------ Executing command in server server6 Fri Dec 16... (7 Replies)
Discussion started by: rymnd_12345
7 Replies

6. Shell Programming and Scripting

Adding days to system date then compare to a date

Hi! I am trying to read a file and every line has a specific date as one of its fields. I want to take that date and compare it to the date today plus 6 days. while read line do date=substr($line, $datepos, 8) #date is expected to be YYYYMMDD if ; then ...proceed commands ... (1 Reply)
Discussion started by: kokoro
1 Replies

7. Shell Programming and Scripting

Compare the system date with date from a text file

I get the date that's inside a text file and assigned it to a variable. When I grep the date from the file, I get this, Not After : Jul 28 14:09:57 2017 GMT So I only crop out the date, with this command echo $dateFile | cut -d ':' -f 2,4The result would be Jul 28 14:57 2017 GMT How do I... (3 Replies)
Discussion started by: Loc
3 Replies

8. SCO

Cannot use 'date -t' to set the system date and time

Hi! All, I am trying to reset the date and time since the change in time over the weekend. I cannot issue the command date -t 201703131330. The system gives me an error invalid option. This happens on my SCO OpenServer 5.0.7 and 5.0.6. Do anyone have an idea why? I even tried using... (6 Replies)
Discussion started by: trolley
6 Replies

9. UNIX for Beginners Questions & Answers

Compare date in .txt with system date and remove if it's lesser than system date

Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt . I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies

10. Answers to Frequently Asked Questions

Compare date in .txt with system date and remove if it's lesser than system date

I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
1 Replies
xargs(1)						      General Commands Manual							  xargs(1)

Name
       xargs - construct argument list and execute command

Syntax
       xargs [flags] [ command [initial-arguments] ]

Description
       The command combines fixed initial-arguments with arguments read from standard input to execute a specified command one or more times.  The
       number of arguments read when a command is invoked and how they are combined is determined by the options specified.

       The specified command, (which can be a Shell file) is searched for using ones' $PATH specification.  If command is not specified, /bin/echo
       is used.

       Arguments  read	from  standard	input  are defined as contiguous strings of characters delimited by one or more blanks, tabs, or newlines;
       empty lines are always discarded.  Blanks and tabs can be embedded as part of an argument if they contain an escape character  or  if  they
       are  quoted.   Characters enclosed in quotes (single or double) are taken literally, and the delimiting quotes are removed; a backslash ()
       escapes the next character.

Options
       Each argument list begins with the initial-arguments, followed by arguments read from standard input, with the exception of the -i  option.
       See the description of the -i option for more information.

       The  options -i, -l, and -n determine how arguments are selected when each command is invoked.  If none of these options are specified, the
       initial-arguments are followed by arguments read continuously from standard input until the internal buffer is full; then, command executes
       with  the accumulated arguments.  This process repeats until no arguments exist.  When conflicts arise, such as the -l option used with the
       -n, the last option has precedence. The options values are as follows:

       -lnumber
	     Execute command for each non-empty number lines of arguments from standard input.	When command is invoked for the final time, it has
	     fewer  lines  of  arguments if fewer than a specified number remain.  A line ends with the first newline unless the last character of
	     the line is a blank or a tab; a trailing blank or tab signals continuation through the next non-empty line.   If  number  is  is  not
	     specified, the value 1 is assumed.  The option -x is forced.

       -ireplstr (Insert mode)
	     Execute  command for each line from standard input, taking the entire line as a single argument and inserting it in initial-arguments
	     for each occurrence of replstr.  A maximum of five arguments specified in initial-arguments can contain one  or  more  occurrence	of
	     replstr.	Blanks and tabs at the beginning of each line are discarded.  A constructed arguments cannot exceed 255 characters and the
	     option -x is a forced.  A {|} is assumed for replstr if not specified.

       -nnumber
	     Execute command using as many standard input arguments as possible, up to the specified number arguments  maximum.   Fewer  arguments
	     are used if their total size is greater than size characters, and when the last command is invoked, fewer number of arguments remain.
	     If the option -x is also include, each specified number of arguments must fit in the size limitation, or else xargs terminates execu-
	     tion.

       -t (Trace mode)
	     Echo the command and each constructed argument list to file descriptor 2 prior to their execution.

       -p (Prompt mode)
	     Asks  the user whether or not command should be executed each time command is invoked. Trace mode (-t) is turned on to print the com-
	     mand instance to be executed, followed by a ?... prompt.  A reply of y executes the command; any other response does not invoke  that
	     particular command.

       -x    Causes  the  command xargs to terminate if an argument list is greater than the specified size of characters; the option -x is forced
	     by the options -i and -l.	When the options -i, -l, or -n are included, the total length of all arguments must be within  the  speci-
	     fied size limit.

       -ssize
	     The maximum size of each argument list is set to size characters; size must be a positive integer less than or equal to 470. If -s is
	     not included, 470 is the default.	Note that the character count for size includes one extra character  for  each	argument  and  the
	     count of characters in the command name.

       -eeofstr
	     The  option  eofstr  is  taken  as the logical end-of-file string.  Underscore (_) is assumed for the logical EOF string if -e is not
	     specified.  The value -e without eofstr specified turns off the logical EOF string capability; the  underscore  is  taken	literally.
	     The command xargs reads standard input until either end-of-file or the logical EOF string is encountered.

       The command xargs terminates if it receives a return code of -1 from command or if it cannot execute command.  When command is a Shell pro-
       gram, it should explicitly exit with an appropriate value to avoid returning with -1.  See for more information.

Examples
       The following example moves all files from directory $1 to directory $2 and echoes the move command prior to executing it:

       ls $1 | xargs -i -t mv $1/{} $2/{}

       The following example combines the output of the parenthesized commands onto one line, which is then echoed to the end of file log:

       (logname; date; echo $0 $*) | xargs >>log

       In the next example, the user is prompted to specify which files in the current directory are to be archived.  The first  example  archives
       the files one at a time; the second example archives groups of files:

	 ls | xargs -p -l ar r arch

	 ls | xargs -p -l | xargs ar r arch

       The following example executes diff(1) with successive pairs of arguments originally typed as Shell arguments:

       echo $* | xargs -n2 diff

See Also
       sh(1).

																	  xargs(1)
All times are GMT -4. The time now is 01:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy