01-07-2014
For multiple files.
i have 1000 of file in var/www/ how do i replace recursively without moving files from temp.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
This is a search script that I have developed. It finds the records that I look for. However the only thing I want the program to do now is to display a message such as 'Not Found' to appear when a record is not found. So far when a search doesn't display a record, the screen is blank.
... (14 Replies)
Discussion started by: Warrior232
14 Replies
2. UNIX for Dummies Questions & Answers
hi all. i have a little problem. im basically reading input from the user from the keyboard into the variable "phonenumber". I want to do a little error check to check if the user doesnt enter anything in for the value phonenumber.
i had this:
read phonenumber
if
then
.....
else
........ (2 Replies)
Discussion started by: djt0506
2 Replies
3. Shell Programming and Scripting
Hi everyone - I am sure this is a really simple problem but I'm a total noob at Linux scripting:
I wanted to create a script that allows me to compare the current week number to the contents of a text file in my home directory:
VAR1='date +%V'
VAR2='cat /home/fred/file.txt'
... (6 Replies)
Discussion started by: FiniteRed
6 Replies
4. Shell Programming and Scripting
Hi,
I am new to unix and using linux 7.2. I would like to create a script that would make it easyer for me to run my java programms. At the moment I have to type java myJavaprogram
I am trying to write a script that will allow me to type something like this "myscript myJavaprogram" or maybe... (4 Replies)
Discussion started by: cmitulescu
4 Replies
5. Shell Programming and Scripting
Hi everyone, I am facing to one shell script problem, which is as following
Write a shell script that:
Takes a number of arguments.
For each argument, print out all files in the current directory that contain this substring in their name.
I know I need to use grep for the second... (7 Replies)
Discussion started by: shaloovia
7 Replies
6. Shell Programming and Scripting
Hi all,
Here is my requirement
I have to search 'ORA' word in out.log file,if it is present then i need to send that file (out.log) content to some mail id.If 'ORA' word is not in that file then i need to send 'load succesful' message to some mail id.
The below the shell script is not... (5 Replies)
Discussion started by: mak_boop
5 Replies
7. Shell Programming and Scripting
Hi all,
I have set up a simple awk script to calculate the average of values that are printed out a number of times per second (the number of time the printing occurs varies). The data is of the format shown below:
1 4.43
1 3.65
1 2.45
2 7.65
2 8.23
2 5.65
3 4.65
3 6.21
.. ..
120... (4 Replies)
Discussion started by: omnomtac
4 Replies
8. Shell Programming and Scripting
#!/bin/csh
echo hello world
this is what i got in a text file called ss1.
i type "chmod 755 ss1.txt" to make it executable.
then when i type
ss1
or
ss1.txt
it says
"ss1 command not found"
what am i doing wrong? (19 Replies)
Discussion started by: pantelis
19 Replies
9. UNIX for Dummies Questions & Answers
Hello forum memebers.
can you correct the simple while program.
#! /bin/ksh
count=10
while
do
echo $count
count='expr$count-1'
done
I think it will print 10 to 1 numbers but it running for indefinite times. (2 Replies)
Discussion started by: rajkumar_g
2 Replies
10. Shell Programming and Scripting
#!/bin/bash
cd /media/disk-2
Running
./run.sh
it's not changing directory.Why? (6 Replies)
Discussion started by: cola
6 Replies
LEARN ABOUT CENTOS
test::taint
Taint(3) User Contributed Perl Documentation Taint(3)
NAME
Test::Taint - Tools to test taintedness
VERSION
Version 1.06
SYNOPSIS
taint_checking_ok(); # We have to have taint checking on
my $id = "deadbeef"; # Dummy session ID
taint( $id ); # Simulate it coming in from the web
tainted_ok( $id );
$id = validate_id( $id ); # Your routine to check the $id
untainted_ok( $id ); # Did it come back clean?
ok( defined $id );
DESCRIPTION
Tainted data is data that comes from an unsafe source, such as the command line, or, in the case of web apps, any GET or POST transactions.
Read the perlsec man page for details on why tainted data is bad, and how to untaint the data.
When you're writing unit tests for code that deals with tainted data, you'll want to have a way to provide tainted data for your routines
to handle, and easy ways to check and report on the taintedness of your data, in standard Test::More style.
"Test::More"-style Functions
All the "xxx_ok()" functions work like standard "Test::More"-style functions, where the last parm is an optional message, it outputs ok or
not ok, and returns a boolean telling if the test passed.
taint_checking_ok( [$message] )
Test::More-style test that taint checking is on. This should probably be the first thing in any *.t file that deals with taintedness.
tainted_ok( $var [, $message ] )
Checks that $var is tainted.
tainted_ok( $ENV{FOO} );
untainted_ok( $var [, $message ] )
Checks that $var is not tainted.
my $foo = my_validate( $ENV{FOO} );
untainted_ok( $foo );
tainted_ok_deeply( $var [, $message ] )
Checks that $var is tainted. If $var is a reference, it recursively checks every variable to make sure they are all tainted.
tainted_ok_deeply( \%ENV );
untainted_ok_deeply( $var [, $message ] )
Checks that $var is not tainted. If $var is a reference, it recursively checks every variable to make sure they are all not tainted.
my %env = my_validate( \%ENV );
untainted_ok_deeply( \%env );
Helper Functions
These are all helper functions. Most are wrapped by an "xxx_ok()" counterpart, except for "taint" which actually does something, instead
of just reporting it.
taint_checking()
Returns true if taint checking is enabled via the -T flag.
tainted( $var )
Returns boolean saying if $var is tainted.
tainted_deeply( $var )
Returns boolean saying if $var is tainted. If $var is a reference it recursively checks every variable to make sure they are all tainted.
taint( @list )
Marks each (apparently) taintable argument in @list as being tainted.
References can be tainted like any other scalar, but it doesn't make sense to, so they will not be tainted by this function.
Some "tie"d and magical variables may fail to be tainted by this routine, try as it may.)
taint_deeply( @list )
Similar to "taint", except that if any elements in @list are references, it walks deeply into the data structure and marks each taintable
argument as being tainted.
If any variables are "tie"d this will taint all the scalars within the tied object.
AUTHOR
Written by Andy Lester, "<andy@petdance.com>".
COPYRIGHT
Copyright 2004, Andy Lester, All Rights Reserved.
You may use, modify, and distribute this package under the same terms as Perl itself.
perl v5.16.3 2012-10-19 Taint(3)