03-17-2013
Delete all content in folder and not show any stderr/stdout
Hi i am a newbie, and have trying something that looked easy at first sight.
in this script i want to delete all the files and directories in subdirectory1 (but not delete subdirectory1) and dont show any stderr or stdout messages:
i try this but the stderr and stdout is shown...and it says that i am trying to delete /dev/null...please help:
rm -rf /directory1/subdirectory1/* /dev/null 2>&1
this is my file system...
directory1
|
|
| ------subdirectory1
| |
| |
| |----------subsubdirectory1
|
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can I redirect and append stdout and stderr to a file when using cron? Here is my crontab file:
*/5 * * * * /dir/php /dir/process_fns.php >>& /dir/dump.txt
Cron gives me an 'unexpected character found in line' when trying to add my crontab file.
Regards,
Zach Curtis
POPULUS (8 Replies)
Discussion started by: zcurtis
8 Replies
2. Shell Programming and Scripting
#!/usr/bin/perl
open(STDOUT, ">>$Textfile")
open(STDERR, ">>$Textfile")
print "program running\n";
$final = join("+", $initial,$final) #5
close (STDOUT);
close (STDERR);Hi all, above is my perl code. Notice i have captured the stdout and stderr to the same textfile. my code is expected to... (1 Reply)
Discussion started by: new2ss
1 Replies
3. UNIX for Advanced & Expert Users
Hello Everyone!
I'm trying to combine output for standard output and for possible standard error to the log file. I was trying to use tee command, but it turned out if error occurred error output will be send to the screen only and will not be redirected with tee command to the log file.
Anyone... (11 Replies)
Discussion started by: slavam
11 Replies
4. Shell Programming and Scripting
Hi friends
I am facing one problem while redirecting the out of the stderr and stdout to a file
let example my problem with a simple example
I have a file (say test.sh)in which i run 2 command in the background
ps -ef &
ls &
and now i am run this file and redirect the output to a file... (8 Replies)
Discussion started by: sushantnirwan
8 Replies
5. Shell Programming and Scripting
I have been doing this:
make xyz &> xyz.log &; tail -f xyz.log
The problem with this is that you never can ge sure when "make xyz" is done.
How can I pipe both stderr and stdout into tee so both stderr and stdout are copied both to the display and to the log file?
Thanks,
Siegfried (3 Replies)
Discussion started by: siegfried
3 Replies
6. Shell Programming and Scripting
Hello all,
I have a for loop executing in a script that I want to redirect STDOUT to screen and to file, while directing STDERR to the bit bucket. Here is the general sentax of what I'm doing:
for i in thingy
do
some_command ${i}
done 1>&1 | tee ${LOGFILE} 2> /dev/null
What I am... (2 Replies)
Discussion started by: LinuxRacr
2 Replies
7. Red Hat
Hi all. I am trying to use backticks in Perl to put STDERR into a string. The code is...
$readkey_test = `perl -MTerm::ReadKey -e 1`;
print $readkey_test;
if ($readkey_test =~ m/]/)
{
print "ReadKey not installed...\n";
}
else
{
print "ReadKey installed...\n";
}
If it comes up... (3 Replies)
Discussion started by: austinharris43
3 Replies
8. Shell Programming and Scripting
Can somebody explain to me why the diff output is not going to stderr?
Yet when I issue a diff from the command line the return code is -ne 1.
I am guessing diff always writes to stdout???
Is there away I can force the difff to write to stderr USING THE CURRENT
template. If possible, I... (5 Replies)
Discussion started by: BeefStu
5 Replies
9. Programming
I originally wrote my script using the korn shell and had to port it to bash on a another server. My script is working find for backing up but noticed that now after the move, I am not getting any output to my log files.
Using Korn shell, this worked for me for some odd reason. This was sending... (2 Replies)
Discussion started by: metallica1973
2 Replies
10. Shell Programming and Scripting
Hi all,
can someone help me with the next redirection?
i want to redirect the stdout+stderr of a command to the same file (this i can do by prog &> file)
but in addition i want to redirect only the stderr to a different file.
how can i do this please? (in BASH)
thanks. (4 Replies)
Discussion started by: eee
4 Replies
LEARN ABOUT HPUX
delete_clearinghouse
delete clearinghouse(1m) delete clearinghouse(1m)
NAME
delete clearinghouse - Deletes the specified clearinghouse from the local server system
SYNOPSIS
cdscp delete clearinghouse clearinghouse-name
ARGUMENT
The full name of the clearinghouse.
DESCRIPTION
The delete clearinghouse command deletes a clearinghouse from the local server system. CDS does not permit you to delete a cleared clear-
inghouse. Before you can delete a cleared clearinghouse, you must recreate it using the create clearinghouse command.
The delete clearinghouse command automatically deletes all read-only replicas from a clearinghouse. CDS does not permit you to delete a
clearinghouse that contains a master replica. See the DCE Directory Service module of the DCE Administration Guide for more information
about handling master replicas when deleting a clearinghouse.
Permissions Required
You must have write and delete permission to the clearinghouse and administer permission to all directories that store replicas in the
clearinghouse. The server principal needs delete permission to the associated clearinghouse object entry and administer permission to all
directories that store replicas in the clearinghouse.
NOTES
It is recommended that you delete all replicas except the root before issuing this command.
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE.
EXAMPLE
The following command deletes a clearinghouse named /.:/sales/Orion_CH from the local server system: cdscp> delete clearinghouse
/.:/sales/Orion_CH
RELATED INFORMATION
Commands: clear clearinghouse(1m), create clearinghouse(1m), list clearinghouse(1m), set cdscp preferred clearinghouse(1m), show clearing-
house(1m), show cdscp preferred clearinghouse(1m)
Books: DCE Administration Guide
delete clearinghouse(1m)