Sponsored Content
Top Forums Shell Programming and Scripting Need help make pkgadd command Non-Interactive Post 302991065 by Corona688 on Monday 6th of February 2017 10:40:39 AM
Old 02-06-2017
/absolute/path/to/chown
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to make a cshell (csh) script interactive

Experts, I tried to make my cshell script interactive by asking the user for password and trying to read the input using the "read" command. I have been unsuccessful so far. Do you have any idea ? Thanks Jim (2 Replies)
Discussion started by: jimmynath
2 Replies

2. UNIX for Advanced & Expert Users

SU command in non interactive mode

Can i run the SU command in a non interactive mode. What i want to do is to pass the username and the password as commandline or batch parameters. Please let me if its possible and how to pass them. A sample file will be appreciated. Thanks, (6 Replies)
Discussion started by: rohitag
6 Replies

3. Shell Programming and Scripting

How to make interactive shell script a automated one?

Hi, I am new to shell scripting.I have written a very simple shell scipt that asks for the username and password on executing. i.e echo "Enter username :" read usrname; echol "Enter password :"; read passwd; echo usrname; echo passwd; but now I want to make it automatic , such... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

4. UNIX for Dummies Questions & Answers

nohup has a terrible bad performance compared with interactive command, why?

I have a strange situation. I'm running a shell script containing several data uploads (using Oracle sqlloader utility). This script is being run on a Red Hat server. I tried to run it in background: $ nohup upload.sh & This script uploads some thousands files. After several hours I... (0 Replies)
Discussion started by: viniciov
0 Replies

5. Homework & Coursework Questions

How to write script that behaves both in interactive and non interactive mode

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (8 Replies)
Discussion started by: rits
8 Replies

6. AIX

Non interactive command output using script command ?

Hello, Script command helps to save command output to file. (Redicection doesn't work in this case). Besides interactive shell 'recording', Linux script command has "-c" option which allows to record output of some non-interactive command. The problem is that AIX script command variant... (6 Replies)
Discussion started by: vilius
6 Replies

7. Shell Programming and Scripting

How to make command line interactive?

I have a file with stats for different month, I use the cat and grep combination to search for different month. cat <file> | grep "April" cat <file> | grep "May" cat <file> | grep "June" etc. How do you make this command interactive. So that I can give the values for the search. Thanks... (7 Replies)
Discussion started by: purelltab
7 Replies

8. Shell Programming and Scripting

Expect command use for interactive mode of scripting

Hi All, I am writing a script(Auto_Installation.sh) which is calling one another script (./update_manager /spare/install/HO7/PME_Response_file.txt) Now the issue is result of (./update_manager /spare/install/HO7/PME_Response_file.txt) script is ##########################################... (6 Replies)
Discussion started by: Dhruvak
6 Replies

9. Shell Programming and Scripting

Shell script using an interactive command

Hello experts, I have a to write script for monitoring, the script would use a command and I plan to write the script as follows while true do command -arg sleep 2 clear done The output would be set up on a screen for monitoring. However the issue is that the command used in... (2 Replies)
Discussion started by: maverick_here
2 Replies

10. Shell Programming and Scripting

Non-interactive pkgadd not working.

Inorder to make the pkgadd non-interactive i tried couple of things but both failed. 1. sudo pkgadd -n /u/mont/admin -d /u/mont/dbprd.pkg pkgadd: ERROR: no packages were found in </var/spool/pkg> 2. yes all | sudo pkgadd -a /u/mont/admin -d /u/mont/dbprd.pkg ... (0 Replies)
Discussion started by: mohtashims
0 Replies
CHOWN(2)						      BSD System Calls Manual							  CHOWN(2)

NAME
chown, fchown, lchown, fchownat -- change owner and group of a file LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> int chown(const char *path, uid_t owner, gid_t group); int fchown(int fd, uid_t owner, gid_t group); int lchown(const char *path, uid_t owner, gid_t group); int fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); DESCRIPTION
The owner ID and group ID of the file named by path or referenced by fd is changed as specified by the arguments owner and group. The owner of a file may change the group to a group of which he or she is a member, but the change owner capability is restricted to the super-user. The chown() system call clears the set-user-id and set-group-id bits on the file to prevent accidental or mischievous creation of set-user-id and set-group-id programs if not executed by the super-user. The chown() system call follows symbolic links to operate on the target of the link rather than the link itself. The fchown() system call is particularly useful when used in conjunction with the file locking primitives (see flock(2)). The lchown() system call is similar to chown() but does not follow symbolic links. The fchownat() system call is equivalent to the chown() and lchown() except in the case where path specifies a relative path. In this case the file to be changed is determined relative to the directory associated with the file descriptor fd instead of the current working direc- tory. Values for flag are constructed by a bitwise-inclusive OR of flags from the following list, defined in <fcntl.h>: AT_SYMLINK_NOFOLLOW If path names a symbolic link, ownership of the symbolic link is changed. If fchownat() is passed the special value AT_FDCWD in the fd parameter, the current working directory is used and the behavior is identical to a call to chown() or lchown() respectively, depending on whether or not the AT_SYMLINK_NOFOLLOW bit is set in the flag argument. One of the owner or group id's may be left unchanged by specifying it as -1. RETURN VALUES
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The chown() and lchown() will fail and the file will be unchanged if: [ENOTDIR] A component of the path prefix is not a directory. [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters. [ENOENT] The named 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. [EPERM] The operation would change the ownership, but the effective user ID is not the super-user. [EPERM] The named file has its immutable or append-only flag set, see the chflags(2) manual page for more information. [EROFS] The named file resides on a read-only file system. [EFAULT] The path argument points outside the process's allocated address space. [EIO] An I/O error occurred while reading from or writing to the file system. The fchown() system call will fail if: [EBADF] The fd argument does not refer to a valid descriptor. [EINVAL] The fd argument refers to a socket, not a file. [EPERM] The effective user ID is not the super-user. [EROFS] The named file resides on a read-only file system. [EIO] An I/O error occurred while reading from or writing to the file system. In addition to the errors specified for chown() and lchown(), the fchownat() system call may fail if: [EBADF] The path argument does not specify an absolute path and the fd argument is neither AT_FDCWD nor a valid file descriptor open for searching. [EINVAL] The value of the flag argument is not valid. [ENOTDIR] The path argument is not an absolute path and fd is neither AT_FDCWD nor a file descriptor associated with a directory. SEE ALSO
chgrp(1), chflags(2), chmod(2), flock(2), chown(8) STANDARDS
The chown() system call is expected to conform to ISO/IEC 9945-1:1990 (``POSIX.1''). The fchownat() system call follows The Open Group Extended API Set 2 specification. HISTORY
The chown() function appeared in Version 7 AT&T UNIX. The fchown() system call appeared in 4.2BSD. The chown() system call was changed to follow symbolic links in 4.4BSD. The lchown() system call was added in FreeBSD 3.0 to compensate for the loss of functionality. The fchownat() system call appeared in FreeBSD 8.0. BSD
April 10, 2008 BSD
All times are GMT -4. The time now is 08:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy