Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Difference between xargs and exec Post 73908 by reborg on Monday 6th of June 2005 12:10:30 PM
Old 06-06-2005
As Perderabo siad the + is a useful option if available, and is in POSIX but not implemented by all versions of find, most noticeably ( for a lot of people ) it is not found in the GNU version of find

from the GNU find man page:
Code:
-exec command +
              This variant of -exec is not yet supported, but is required by POSIX.

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

difference between source, exec and ./script

What is the difference between sourcing a script, running it or execing it? (1 Reply)
Discussion started by: 98_1LE
1 Replies

2. Shell Programming and Scripting

MV files with xargs or -exec

Hi I need to move multiple (say 10 files) from one location to another location. My selection would be like this... ls -ltr *.arc | head ---> Need to move top 10 files with single command without iterating in loop. I know we can move files like this with find command but not sure if I can... (4 Replies)
Discussion started by: malaymaru
4 Replies

3. Shell Programming and Scripting

String substitution on find results inside exec/xargs

What I'm trying to do is perform a copy, well a ditto actually, on the results of a find command, but some inline string substitution needs to happen. So if I run this code find ./ -name "*.tif" I get back these results. .//1234567.tif .//abcdefg.tif Now the action from exec or xargs I... (2 Replies)
Discussion started by: myndcraft
2 Replies

4. AIX

Difference in Using xargs

Hi , Can somebody explain what is the difference in the below commands.. when using Xargs its giving all the hidden files and is it something xargs will do recursive searching or parsing ? find . -type f -links 1 | xargs ls -li find . -type f -links 1 | ls -li (1 Reply)
Discussion started by: Karthikeyan K
1 Replies

5. Shell Programming and Scripting

Difference between using xargs and backticks

Hey all. Just a fast question, what is the technical difference between using back ticks and using xargs to perform a command? Here's an example Find /mydir -name *.conf |xargs rm Vs Rm 'find /mydir -name *.conf' Is there a performance hit? I know they do the same thing but which is... (1 Reply)
Discussion started by: msarro
1 Replies

6. Programming

difference bewteen pipe, xargs, and exec

I have read several docs on these on the web and looked at examples. I can't figure out the difference. In some cases you use one or the other or you combine them. can someone help me understand this? (1 Reply)
Discussion started by: guessingo
1 Replies

7. Shell Programming and Scripting

Script Variables Inquiry, Values Okay in Standalone Exec, No-Show in Cron Exec

I have the following bash script lines in a file named test.sh. #!/bin/bash # # Write Date to cron.log # echo "Begin SSI Load $(date +%d%b%y_%T)" # # Get the latest rates file for processing. # d=$(ls -tr /rms/data/ssi | grep -v "processed" | tail -n 1) filename=$d export filename... (3 Replies)
Discussion started by: ginowms
3 Replies

8. Shell Programming and Scripting

xargs vs exec with find:

Hi All, i'm trying to create a tar of all the .txt files i find in my dir . I've used xargs to acheive this but i wanted to do this with exec and looks like it only archives the last file it finds . can some one advice what's wrong here : find . -type f -name "*.txt" -print0 | xargs -0... (9 Replies)
Discussion started by: Irishboy24
9 Replies

9. Shell Programming and Scripting

Difference b/w xargs and "-exec" in Find

Hi, What is the difference between the following commands find . -type f -exec grep 'abc' {} \; and find . -type f | xargs grep 'abc' Appreciate your help. (2 Replies)
Discussion started by: bobbygsk
2 Replies

10. Shell Programming and Scripting

Exec and xargs mvoe file to directory

Hello, I am trying to move all the file listed by below command to /tmp/testing directory find ./ -maxdepth 1 -type f -mtime +3 I tried using -exec and xargs - none of the combination is working? Please, help (3 Replies)
Discussion started by: saurabh84g
3 Replies
CONFSTR(3)						     Linux Programmer's Manual							CONFSTR(3)

NAME
confstr - get configuration dependent string variables SYNOPSIS
#include <unistd.h> size_t confstr(int name, char *buf, size_t len); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): confstr(): _POSIX_C_SOURCE >= 2 || _XOPEN_SOURCE DESCRIPTION
confstr() gets the value of configuration-dependent string variables. The name argument is the system variable to be queried. The following variables are supported: _CS_GNU_LIBC_VERSION (GNU C library only; since glibc 2.3.2) A string which identifies the GNU C library version on this system (e.g., "glibc 2.3.4"). _CS_GNU_LIBPTHREAD_VERSION (GNU C library only; since glibc 2.3.2) A string which identifies the POSIX implementation supplied by this C library (e.g., "NPTL 2.3.4" or "linuxthreads-0.10"). _CS_PATH A value for the PATH variable which indicates where all the POSIX.2 standard utilities can be found. If buf is not NULL and len is not zero, confstr() copies the value of the string to buf truncated to len - 1 bytes if necessary, with a null byte ('') as terminator. This can be detected by comparing the return value of confstr() against len. If len is zero and buf is NULL, confstr() just returns the value as defined below. RETURN VALUE
If name is a valid configuration variable, confstr() returns the number of bytes (including the terminating null byte) that would be required to hold the entire value of that variable. This value may be greater than len, which means that the value in buf is truncated. If name is a valid configuration variable, but that variable does not have a value, then confstr() returns 0. If name does not correspond to a valid configuration variable, confstr() returns 0, and errno is set to EINVAL. ERRORS
EINVAL The value of name is invalid. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +----------+---------------+---------+ |Interface | Attribute | Value | +----------+---------------+---------+ |confstr() | Thread safety | MT-Safe | +----------+---------------+---------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008. EXAMPLE
The following code fragment determines the path where to find the POSIX.2 system utilities: char *pathbuf; size_t n; n = confstr(_CS_PATH, NULL, (size_t) 0); pathbuf = malloc(n); if (pathbuf == NULL) abort(); confstr(_CS_PATH, pathbuf, n); SEE ALSO
getconf(1), sh(1), exec(3), fpathconf(3), pathconf(3), sysconf(3), system(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2017-09-15 CONFSTR(3)
All times are GMT -4. The time now is 07:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy