Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Difference between xargs and exec Post 73975 by reborg on Tuesday 7th of June 2005 02:41:11 AM
Old 06-07-2005
Quote:
Originally Posted by vibhor_agarwali
I have to quote it, does exec automatically quotes it parameters.
Thanks
Each filename is passes to exec as a single value, with special characters escaped, so it is as if the filename has been enclosed in single quotes.
 

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
IVMCONFIGPROPERTIES.XML(5)					File Formats Manual					IVMCONFIGPROPERTIES.XML(5)

NAME
IvmConfigProperties.xml - device properties to be monitored by ivman(8) DESCRIPTION
IvmConfigProperties.xml specifies hardware properties to be monitored by ivman(8), and allows running of certain commands when device prop- erties change. IvmConfigProperties.xml is parsed as an XML file. The general form of the file is: <?xml version="1.0" encoding="UTF-8"?> <ivm:PropertiesConfig version="0.1" xmlns:ivm="http://www.eikke.com/ivm"> <ivm:Match name="matchname" value="matchvalue"> <ivm:Property name="propertyname"> <ivm:Action value="propertyvalue1" exec="command1" /> <ivm:Action value="propertyvalue2" exec="command2" /> ... </ivm:Property> </ivm:Match> ... </ivm:PropertiesConfig> Each time a property changes on a device, this file will be parsed. If the Match rule matches the device on which the property changed, and the Property rule matches the name of the property which changed, then all of the Action rules within that Property tag wil be parsed. If 'value' is equal to the new value of the changed property, then the command specified in 'exec' will be executed. A Match element can have any of the following names: ivm.mountable Whether or not HAL specifies that a device can and should be mounted. Must be "true" or "false". hal.anything The string in place of "anything" will be taken as the name of a HAL property string for the device, and the value of the prop- erty will be compared to the value given. Run 'lshal' to see a list of HAL properties which can be used here. * Match every device. Use with care! As many Matches can be nested as is desired. A Property element can have the following name: hal.anything The string in place of "anything" will be taken as the name of a HAL property string for the device, and if this is the prop- erty that has changed, enclosed rules will be processed. An Action element can have any string as its 'value'. If the new value of the changed property is equal to this string, then the command given as the 'exec' property will be executed. It can also have the special value '*'; in this case, the 'exec' command will be executed every time the property changes. exec supports substitution of HAL device properties. This is accomplished by surrounding the property name with $ symbols. For instance, if $hal.volume.mount_point$ is within a command, it will be replaced with the volume's mount point before execution. No character escaping is done in the substitution, but the characters ' and " are replaced with ?, so you can surround the substitution with quotes without fear. There is also a single Option which can be set in this file, and should be set outside of any Match or Property blocks. The syntax of this option is: <ivm:Option name="checkOnInit" value="true" /> If the value of checkOnInit is true, then Ivman will check every device on the system for matching rules when started. For example, if a rule was present which started a service only when a particular volume was mounted, and Ivman was started when the volume was already mounted, it would start the service if and only if checkOnInit was set to true. Remember that this is an XML file, which means that characters which have a special meaning in XML (entities) need to be escaped. Some characters which are popular in shell scripting (&, <, >) are among these special characters. As a quick reference, & becomes &amp; , < becomes &lt; , > becomes &gt; , ' becomes &apos; and " becomes &quot; . SEE ALSO
ivman(8), IvmConfigBase.xml(5), IvmConfigActions.xml(5), IvmConfigConditions.xml(5) 12 May 2005 IVMCONFIGPROPERTIES.XML(5)
All times are GMT -4. The time now is 09:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy