08-09-2010
thanks alott it workss
what if i want to but if condition to check out if the file exists in the directory or not
if the file exists then check the size of the file if the size zero then copy it if the file bigger that zero then don't copy. if the file not exists copy it. and i want to make the code to read the path as paramter of the file "pwd".
thanks for ur help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I will be very grateful if someone can help me with bash shell script that does the following:
I have a list of filenames:
A01_155716
A05_155780
A07_155812
A09_155844
A11_155876
that are kept in different sub directories within my current directory. I want to find these files and copy... (3 Replies)
Discussion started by: manishabh
3 Replies
2. Shell Programming and Scripting
dear all.
how can i copy a list of files with different names into others directory have the same name
like i have 3 files
10_10
10_10_11
10_10_11_12
and i have 3 directories
10_10
10_10_11
10_10_11_12
how can i make a loop to cp this files into the directory have the same name like... (0 Replies)
Discussion started by: t17
0 Replies
3. Shell Programming and Scripting
....... (2 Replies)
Discussion started by: pcbuilder
2 Replies
4. Shell Programming and Scripting
Hi.
I have a list with file names like
testfile1.wav
testfile2.wav
testfile3.wav
and a folder that contains a large number of wav files (not only the ones on the list).
I would like to copy the files whose names are on the list from the wav file directory to a new directory.
I... (5 Replies)
Discussion started by: Bloomy
5 Replies
5. Shell Programming and Scripting
got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies
6. Shell Programming and Scripting
Hello,
I have a folder with a massive amount of files, and I want to copy out a specific subset of the files to a new directory. I would like to use a text file with the filenames listed, but can't get it to work.
The thing I'm hung up on is that the folder names in the path can and do have... (5 Replies)
Discussion started by: twjolson
5 Replies
7. Shell Programming and Scripting
Hi
I have 3 directories
indexes_with_ts
indexes_without_ts
process_indexes
in each directories it contains *.sql
how do I accomplish this:
for all the files found in indexes_without_ts, copy the corresponding file in indexes_with_ts to process_indexes.
i.e.
for... (2 Replies)
Discussion started by: jediwannabe
2 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
Can any one help me to list out the directory names which contain the specified file.
See for example
File name : file.201307014.LKT
Have the directory structure as below.
/app/work/data/INDIA/file.201307014.LKT
/app/work/data/AMERICA/file.201307014.KTP... (5 Replies)
Discussion started by: Balasankar
5 Replies
9. Shell Programming and Scripting
Hi ,
I'm trying to list the files and output is written to a file. But when I execute the command , the output file is being listed. How to exclude it ?
/tmp
file1.txt
file2.txt
ls -ltr |grep -v '-' | awk print {$9, $5} > output.txt
cat output.txt
file1.txt
file2.txt
output.txt (8 Replies)
Discussion started by: etldeveloper
8 Replies
10. Shell Programming and Scripting
Given a directory containing say a few thousand files,
please output a list of all the names of the files in the directory that are exactly the same, i.e. have the same contents.
func(a_directory_name) output -> {“matches”: , ... ]}
e.g. func(“/home/my/files”) where the directory... (7 Replies)
Discussion started by: anuragpgtgerman
7 Replies
LEARN ABOUT DEBIAN
ausearch_add_interpreted_item
AUSEARCH_ADD_INTERPRETED_ITEM(3) Linux Audit API AUSEARCH_ADD_INTERPRETED_ITEM(3)
NAME
ausearch_add_interpreted_item - build up search rule
SYNOPSIS
#include <auparse.h>
int ausearch_add_interpreted_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how);
DESCRIPTION
ausearch_add_interpreted_item adds one search condition to the current audit search expression. The search conditions can then be used to
scan logs, files, or buffers for something of interest. The field value is the field name that the value will be checked for. The op vari-
able describes what kind of check is to be done. Legal op values are:
exists
just check that a field name exists
=
locate the field name and check that the value associated with it is equal to the value given in this rule.
!=
locate the field name and check that the value associated with it is NOT equal to the value given in this rule.
The value parameter is compared to the interpreted field value (the value that would be returned by auparse_interpret_field(3)).
The how value determines how this search condition will affect the existing search expression if one is already defined. The possible val-
ues are:
AUSEARCH_RULE_CLEAR
Clear the current search expression, if any, and use only this search condition.
AUSEARCH_RULE_OR
If a search expression E is already configured, replace it by (E || this_search_condition).
AUSEARCH_RULE_AND
If a search expression E is already configured, replace it by (E && this_search_condition).
RETURN VALUE
Returns -1 if an error occurs; otherwise, 0 for success.
SEE ALSO
ausearch_add_expression(3), ausearch_add_item(3), ausearch_add_timestamp_item(3), ausearch_add_regex(3), ausearch_set_stop(3), ause-
arch_clear(3), ausearch_next_event(3), ausearch-expression(5).
AUTHOR
Steve Grubb
Red Hat Nov 2007 AUSEARCH_ADD_INTERPRETED_ITEM(3)