03-09-2008
say something like this?
#!/bin/sh
pattern= word|word|word|word(Put your pattern here or read it from a file)
while :
do
case $pattern in
$pattern) rm -rf $1
*) echo "File Safe:$1 "
$1 >>/root/upload.log
esac
done
9 More Discussions You Might Find Interesting
1. Programming
PROGRAM A <-> PROGRAM B
PROGRAM A sends data as STDIN ro PROGRAM B and when PROGRAM B is executed from PROGRAM A, it sends output back to PROGRAM A. This is implemented using 2 pipes (fd1 & fd2).
The above process happens in a loop and during the second run, the previous data that had been... (10 Replies)
Discussion started by: vvaidyan
10 Replies
2. UNIX for Advanced & Expert Users
I have the following code which works on AIX 4.3 but fails at times on AIX 5.3
with:
cat: 0652-054 cannot write to output. There is no process to read data written to a pipe.
validator="${validator_exe} ${validator_parms}"
cmd_line="${CAT} ${data_file} | ${validator}... (6 Replies)
Discussion started by: vigsgb
6 Replies
3. Shell Programming and Scripting
I have 2 files. I basically want to search both of them to see if the 1st column ($1) matches and if it matches then check to see if the 2nd column ($2) matches, then execute some code showing the results of the matches.
File 1:
AAA 123
misc blah
BBB 456
CCC 789
File 2:
... (2 Replies)
Discussion started by: streetfighter2
2 Replies
4. Shell Programming and Scripting
I don't quite know what I'm doing, so this simple script is proving a challenge.
Here is some pseudo code that doesn't work yet:
if tail -1 "WORKING.txt" >/dev/null | egrep "^NMBR=*" > /dev/null
then
curl -k 'http://www.myserver.com/log.cgi?input=$?'
echo "hi there"
fi
Purpose:... (3 Replies)
Discussion started by: dihewidd
3 Replies
5. Shell Programming and Scripting
Hi,
I have one dir which has N subdirs.For ex:
/home/user/Project_Src
/home/user/Project_Src/Dir_A
/home/user/Project_Src/Dir_A/subdir/sub_dir2
/home/user/Project_Src/Dir_A/subdir/sub_dir3
/home/user/Project_Src/Dir_B
/home/user/Project_Src/Dir_B/Build
i want to create a folder with... (2 Replies)
Discussion started by: dragon.1431
2 Replies
6. Shell Programming and Scripting
hi,
i have a service on unix platform, it will generate traces in a particular folder
i want to check using shell script if traces exist, then perform some action else continue to be in loop.
filename is service.tra
can you please help?
thanks (4 Replies)
Discussion started by: gauravah
4 Replies
7. Shell Programming and Scripting
Hi All,
I need to create a script to monitor a dir for new files with ext .err and also it should b a non empty files. and perform a action or command .
We have a new ETL application that runs on a linux server, every times a etl fails it creates a .err file or updates the existing .err... (4 Replies)
Discussion started by: MAKHAN
4 Replies
8. Shell Programming and Scripting
Hello,
I'm attempting to write a tool that checks an IP address for existing PTR records then if there are no PTR records does a ping to see if it response.
Then if there is no response, it should print a message saying
This is what I have so far.
#!/usr/bin/perl
$nxdomain =... (4 Replies)
Discussion started by: spartan22
4 Replies
9. Shell Programming and Scripting
Hi,
I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files.
Here are the contents of the two files:
File 1:
Date,ParentID,Number,Area,Volume,Dimensions
2014-01-01,ABC,247,83430.33,857.84,8110.76... (9 Replies)
Discussion started by: Prit Siv
9 Replies
LEARN ABOUT HPUX
tt_pattern_user
tt_pattern_user(library call) tt_pattern_user(library call)
NAME
tt_pattern_user -- return the value in a user data cell for a pattern object
SYNOPSIS
#include <Tt/tt_c.h>
void *tt_pattern_user(
Tt_pattern p,
int key);
DESCRIPTION
The tt_pattern_user function returns the value in the indicated user data cell for the specified pattern object.
Every pattern object allows an arbitrary number of user data cells that are each one word in size. The user data cells are identified by
integer keys. The tool can use these keys in any manner to associate arbitrary data with a pattern object.
The user data is part of the pattern object (that is, the storage buffer in the application); it is not part of the actual pattern. The
content of user cells has no effect on pattern matching.
The p argument is a unique handle for a message pattern. This handle is returned after tt_pattern_create is called. The key argument is
the specified user data cell. The application can use tt_pattern_user_set(3) to assign the keys to the user data cells that are part of
the pattern object. The value of each data cell must be unique for this pattern.
RETURN VALUE
Upon successful completion, the tt_pattern_user function returns the data cell, a piece of arbitrary user data that can hold a void *. The
application can use tt_ptr_error(3) to extract one of the following Tt_status values from the returned data:
TT_OK The operation completed successfully.
TT_ERR_NOMP
The ttsession(1) process is not running and the ToolTalk service cannot restart it.
TT_ERR_POINTER
The pointer passed does not point to an object of the correct type for this operation.
APPLICATION USAGE
The user data cell is intended to hold an address. If the address selected is equal to one of the Tt_status enumerated values, the result
of the tt_ptr_error(3) function will not be reliable.
SEE ALSO
Tt/tt_c.h - Tttt_c(5), tt_pattern_user_set(3), tt_pattern_create(3), tt_ptr_error(3).
tt_pattern_user(library call)