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
fnmatch(3C)															       fnmatch(3C)

NAME
fnmatch() - match filename patterns SYNOPSIS
DESCRIPTION
performs pattern matching as described in regexp(5) under By default, the rule qualifications for filename expansion do not apply; i.e., periods (dots) and slashes are matched as ordinary characters. This default behavior can be modified by using the flags described below. The flag argument modifies the interpretation of pattern and string. If which is defined in is set in flag, a slash character in string must be explicitly matched by a slash in pattern; it cannot be matched by either the asterisk or question mark special characters or by a bracket expression. If is set in flag, a leading period must be explicitly matched. It will not be matched by a bracket expression, question mark or asterisk. By default, a period is leading if it is the first character in string. If is set in flag, a period is leading if it is the first charac- ter in string or immediately follows a slash. If is not set in flag, a backslash character in pattern followed by any other character matches that second character in string. In par- ticular, matches a backslash in string. If is set, a backslash character is treated as an ordinary character. If flag is zero, the slash character and the period are treated as regular characters. If flag has any other value, the result is unde- fined. RETURN VALUE
If string matches the pattern specified by pattern, returns zero. Otherwise, returns non-zero. EXAMPLE
The following excerpt uses to check each file in a directory against the pattern pattern = "*.c"; while(dp = readdir(dirp)){ if((fnmatch(pattern, dp->d_name,0)) == 0){ /* do processing for match */ ... } } AUTHOR
was developed by OSF and HP. SEE ALSO
sh(1), glob(3C), thread_safety(5). STANDARDS CONFORMANCE
fnmatch(3C)
All times are GMT -4. The time now is 11:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy