Sponsored Content
Full Discussion: Coding in Phyton
Top Forums Shell Programming and Scripting Coding in Phyton Post 302475446 by misfitplanet on Sunday 28th of November 2010 09:37:18 PM
Old 11-28-2010
Here is how you do it:

One argument example:
Code:
>>> p1 = "path1"
>>> p2 = "path2"
>>> print "result: %s" % (p1)
result: path1

Two argument example:
Code:
>>> print "results: %s, %s" % (p1,p2)
results: path1, path2
>>>

 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

can I use this coding

I apologise because I had pasted this question in the newbies forum first (because i am a bit of a newbie) but thought it might be better suited in here if i have to sepearate parameters can I use this syntax especially the or part (||) and is this correct if (6 Replies)
Discussion started by: w33man
6 Replies

2. AIX

need help for coding this logic

contact me on <email address deleted> or <email address deleted> (1 Reply)
Discussion started by: suprithhr
1 Replies

3. Red Hat

installing phyton in centos

Hi, I am trying to install phyton on my centos. When I write: yum install phyton I get the message that it doesn't find the package. How should I fix it? (4 Replies)
Discussion started by: programAngel
4 Replies

4. Shell Programming and Scripting

Need help with coding

HI, Can some one guide me how to make changes to the script below so that it can load the history of a program to IT server ? Format of data: YYYYMMDD065959.dsk.log YYYYMMDD235959.dsk.log currently both are loaded together. Need to separate them as above format. Thanks in advance. ... (1 Reply)
Discussion started by: crazydude80
1 Replies

5. Windows & DOS: Issues & Discussions

Need help with coding

HI, Can some one guide me how to make changes to the script below so that it can load the history of a program to IT server ? Format of data: YYYYMMDD065959.dsk.log YYYYMMDD235959.dsk.log currently both are loaded together. Need to separate them as above format. Thanks in advance. ... (2 Replies)
Discussion started by: crazydude80
2 Replies
EXCHANGEDATA(2) 					      BSD System Calls Manual						   EXCHANGEDATA(2)

NAME
exchangedata -- atomically exchange data between two files SYNOPSIS
#include <unistd.h> #include <sys/attr.h> int exchangedata(const char * path1, const char * path2, unsigned int options); DESCRIPTION
The exchangedata() function swaps the contents of the files referenced by path1 and path2 in an atomic fashion. That is, all concurrent pro- cesses will either see the pre-exchanged state or the post-exchanged state; they can never see the files in an inconsistent state. The data in all forks is swapped in this way. The options parameter lets you control specific aspects of the function's behaviour. Open file descriptors follow the swapped data. Thus, a descriptor that previously referenced path1 will now reference the data that's acces- sible via path2, and vice versa. In general, the file attributes (metadata) are not exchanged. Specifically, the object identifier attributes (that is, the ATTR_CMN_OBJID and ATTR_CMN_OBJPERMANENTID attributes as defined by the getattrlist(2) function) are not swapped. An exception to this general rule is that the modification time attribute ( ATTR_CMN_MODTIME ) is swapped. When combined, these features allow you to implement a 'safe save' function that does not break references to the file (for example, aliases). You first save the new contents to a temporary file and then exchange the data of the original file and the temporary. Programs that reference the file via an object identifier will continue to reference the original file, but now it has the new data. The path1 and path2 parameters must both reference valid files. All directories listed in the path names leading to these files must be searchable. You must have write access to the files. The options parameter is a bit set that controls the behaviour of exchangedata(). The following option bits are defined. FSOPT_NOFOLLOW If this bit is set, exchangedata() will not follow a symlink if it occurs as the last component of path1 or path2. RETURN VALUES
Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. COMPATIBILITY
Not all volumes support exchangedata(). You can test whether a volume supports exchangedata() by using getattrlist(2) to get the volume capabilities attribute ATTR_VOL_CAPABILITIES, and then testing the VOL_CAP_INT_EXCHANGEDATA flag. ERRORS
exchangedata() will fail if: [ENOTSUP] The volume does not support exchangedata(). [ENOTDIR] A component of the path prefix is not a directory. [ENAMETOOLONG] A component of a path name exceeded NAME_MAX characters, or an entire path name exceeded PATH_MAX characters. [ENOENT] Either file does not exist. [EACCES] Search permission is denied for a component of the path prefix. [ELOOP] Too many symbolic links were encountered in translating the pathname. [EFAULT] path1 or path2 points to an invalid address. [EXDEV] path1 and path2 are on different volumes (mounted file systems). [EINVAL] path1 or path2 reference the same file. [EINVAL] You try to exchange something other than a regular file (for example, a directory). [EIO] An I/O error occurred while reading from or writing to the file system. SEE ALSO
getattrlist(2), rename(2) HISTORY
A exchangedata() function call appeared in Darwin 1.3.1 (Mac OS X version 10.0). It was deprecated in macOS 10.13. Darwin December 15, 2003 Darwin
All times are GMT -4. The time now is 07:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy