Sponsored Content
Top Forums Shell Programming and Scripting using a vaiable parameters and values to find and tar Post 302191465 by Franklin52 on Friday 2nd of May 2008 05:12:49 PM
Old 05-02-2008
Precede the name of the directory with a slash:
Code:
/etc

Regards
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

tar parameters

Hi, I'm not a very experienced in unix and I need some help. I'm trying to figure out what tar parameters to use to store a directory structure and the files within this directory structure. I also need to know how to extract this tar file from one unix machine to another unix machine. If... (4 Replies)
Discussion started by: kmar
4 Replies

2. Programming

Passing Parameters and getting values back from a c program to Shell script

I am having a shell script which has to be called from a C program. I have to pass two parameters to this script. HOw can I do that? eg: int main() { char st1; char str2; // call a shell script call_sh(str1,str2) where call_sh is the name of the shell script. then i need to get the return... (5 Replies)
Discussion started by: Rajeshsu
5 Replies

3. UNIX for Dummies Questions & Answers

Script to update values for the parameters

Hello, I am writing script to substitute values for a parameter in the file but I am getting error. for v1 in grep "pProjectName=" global.cfg do sed -e "/s/$v1/pProjectName=Test/ global.cfg done Please correct me if I am wrong, thanks in advance (1 Reply)
Discussion started by: gmahesh2k
1 Replies

4. Shell Programming and Scripting

Resetting the Positional parameters values

Hi, Can any one provide the Unix command to reset the positional parameters? Please see the below example where i have to pass 2 parameters to Shell1.sh. Step1) . ./Shell1.sh 2 3 successfully executed, Then i executed(next step only) the same shell script again,this time no... (4 Replies)
Discussion started by: nmk
4 Replies

5. Solaris

list tunable parameters and its values (Solaris 8)

Does anyone knows how to list tunable kernel parameters on a Solaris 8 system? A linux sysctl -a equivalent will do the job ... (2 Replies)
Discussion started by: danielsf
2 Replies

6. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

7. Shell Programming and Scripting

tar cmd how many arguments into parameters of filenames

Hi I would like to use tar cmd in my script. I have a variable with filenames, e.g. 1000 records and I would like to paste its values into tar cmd. For this example I used three elements variable strings. strings="file1.txt file2.txt file3.txt" `tar cf file1.tar $strings` Whether... (1 Reply)
Discussion started by: presul
1 Replies

8. UNIX for Dummies Questions & Answers

Default values for positional parameters - dummy question I think

Hi, Sorry for a dummy question I believe. I am just wanting to know how do I assign a default $1 argument if one is not provided. At the moment, I am doing something like below: arg1="${1:-foo}"And then I check $arg1 in case/esac. I am just wondering if there is a way for me to simply do... (3 Replies)
Discussion started by: newbie_01
3 Replies

9. UNIX for Beginners Questions & Answers

Extract values based on parameters passing in arguments

Based on arguments passing in command prompt values should fetch and store in new file. Sample:- sh test.sh 10 30 35 45 cat test.sh .. cut -c $1-$2,$3-$4 file_name >> file_new ... ... Above sample passing 4 arguments.. but it may differ (sh test.sh 10 30 35 45 70 75 ) based on... (1 Reply)
Discussion started by: Jairaj
1 Replies
CHDIR(2)						      BSD System Calls Manual							  CHDIR(2)

NAME
chdir, fchdir -- change current working directory LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> int chdir(const char *path); int fchdir(int fd); DESCRIPTION
The path argument points to the pathname of a directory. The chdir() system call causes the named directory to become the current working directory, that is, the starting point for path searches of pathnames not beginning with a slash, '/'. The fchdir() system call causes the directory referenced by fd to become the current working directory, the starting point for path searches of pathnames not beginning with a slash, '/'. In order for a directory to become the current directory, a process must have execute (search) access to the directory. 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 chdir() system call will fail and the current working directory will be unchanged if one or more of the following are true: [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 directory does not exist. [ELOOP] Too many symbolic links were encountered in translating the pathname. [EACCES] Search permission is denied for any component of the path name. [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 fchdir() system call will fail and the current working directory will be unchanged if one or more of the following are true: [EACCES] Search permission is denied for the directory referenced by the file descriptor. [ENOTDIR] The file descriptor does not reference a directory. [EBADF] The argument fd is not a valid file descriptor. SEE ALSO
chroot(2) STANDARDS
The chdir() system call is expected to conform to ISO/IEC 9945-1:1990 (``POSIX.1''). HISTORY
The chdir() system call appeared in Version 7 AT&T UNIX. The fchdir() system call appeared in 4.2BSD. BSD
December 11, 1993 BSD
All times are GMT -4. The time now is 07:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy