03-04-2008
Hi,
>find /tmp -name "dir[^5]" -type d
Whats the purpose of using "dir[^5]" here?
We can also get the desired result as follows.
find /tmp -name "dir5" -type d
any idea pls.
cheers
RRK
10 More Discussions You Might Find Interesting
1. Solaris
Hi, Any command or means to delete a director which is not empty
rmdir or similar
iam using Sun Solaries 2.6 :confused:
I have many full directories with subdirectories and I can not go on emptying them all (5 Replies)
Discussion started by: adol3
5 Replies
2. Shell Programming and Scripting
Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted.
I've be... (5 Replies)
Discussion started by: cat123
5 Replies
3. UNIX for Dummies Questions & Answers
I know this one was answered before in forum below -
https://www.unix.com/unix-dummies-questions-answers/58210-removing-empty-folders-using-find-command.html
But that one is closed & I have a question so here it goes.
I want to delete all 2006 files. Now if along with the files, if the... (2 Replies)
Discussion started by: kedar.mehta
2 Replies
4. Shell Programming and Scripting
Hello:
I searched here for "vi -c" but found no hits.
How can I use vi -c to remove ALL empty lines, regardless of how many?
I tried
<code>
vi -c ":g/^$/d | wq" filename
</code>
but I have to run it several times.
This is NOT homework. :)
Thanks for your time. (3 Replies)
Discussion started by: Habitual
3 Replies
5. Shell Programming and Scripting
Hi all,
I'm trying to remove when this condition is met: an empty and the next one
I'm using this command:
sed '/^$/N; s/&//' file
Which searches for an empty line, N attaches it to the next line, and substituing the combination with nothing.... but it is not working.
What I'm missing... (1 Reply)
Discussion started by: meuser
1 Replies
6. UNIX for Dummies Questions & Answers
Hi all !
I'm sure it is a basic question but I didn't find any threads that fit my need.
How to remove empty fields with awk?
Or in other words, how to shift all the fields after an empty field on the left?
input:
1|2||3|4|5||6
wanted:
1|2|3|4|5|6
I tried:
awk '{for(i=1; i<=NF;... (7 Replies)
Discussion started by: lucasvs
7 Replies
7. Shell Programming and Scripting
Hello:
Is there a simple way to remove empty records of FASTA format file?
A FASTA format consists of two parts: header and sequence (for non-biologist, Wiki for details of course!). The header always start with ">" for the name of the sequence. The header must be in this ONLY single line.... (9 Replies)
Discussion started by: yifangt
9 Replies
8. Shell Programming and Scripting
Dear community,
I have two output files that contains some CR
# cat first.out
1234567890 598679857648566 9
1234567234 365837465873465 4
2342343243 289374982374894 4
# cat second.out
2342342342 ... (2 Replies)
Discussion started by: Lord Spectre
2 Replies
9. Shell Programming and Scripting
Hi gurus,
I have a script which works fine.
https://www.unix.com/shell-programming-and-scripting/239347-how-pass-string-into-sql-query.html
while read p
do
&& para="'${p}'" || para="${para},'${p}'"
done < filePlease use code tags as required by forum rules!
a few days... (6 Replies)
Discussion started by: ken6503
6 Replies
10. Shell Programming and Scripting
how to remove empty files tried below command its remove only zero bytes not empty file which is greater then zero byte.
for x in *
do
if
then
rm $x
fi
done (8 Replies)
Discussion started by: Kalia
8 Replies
LEARN ABOUT DEBIAN
arch::tempfiles
Arch::TempFiles(3pm) User Contributed Perl Documentation Arch::TempFiles(3pm)
NAME
Arch::TempFiles - help to manage temporary files/dirs
SYNOPSIS
use Arch::TempFiles qw(temp_file_name temp_file temp_dir);
# all will be removed automatically on the script completion
my $file_name1 = temp_file();
my $file_name2 = temp_file_name("status");
my $dir_name = temp_dir("arch-tree");
use Arch::TempFiles;
my $tmp = new Arch::TempFiles;
$tmp->root($tmp->dir);
my $file_name = $tmp->name;
open OUT, ">$file_name";
close OUT;
DESCRIPTION
This module deals with temporary file names. It is similar to File::Temp, but simplier and more focused. Also, File::Temp is relatively new
and was not shipped with older perl versions.
Both function interface and object oriented interface are supported.
FUNCTIONS
/METHODS
The following functions are available:
temp_root, temp_name, temp_file_name, temp_dir_name, temp_file, temp_dir.
The corresponding class methods are available too:
root, name, file_name, dir_name, file, dir.
temp_root [dir]
$tmp->root [dir]
Change or return the root of the temporary files and dirs. The default is either $ENV{TMP_DIR} or "/tmp".
temp_name [label]
$tmp->name [label]
Return the unused temporary file name. The default file name is "/tmp/,,arch-XXXXXX" where XXXXXX is a random number. To change this
name use "temp_root" and/or provide label that replaces "arch".
Please note, that the operation of acquiring the file name using this function/method and actual creating of this file is not atomic.
So you may need to call this method again if the creation is failed, for example if some other process created the same file in the
middle.
temp_file_name [label]
$tmp->file_name [label]
Like "temp_name", but stores the name in the file list that will be removed on the end (on object destruction).
temp_dir_name [label]
$tmp->dir_name [label]
Like "temp_name", but stores the name in the dir list that will be removed on the end (on object destruction).
temp_file [label]
$tmp->file [label]
Like "temp_file_name", but also creates the file.
temp_dir [label]
$tmp->dir [label]
Like "temp_dir_name", but also creates the dir.
BUGS
Awaiting for your reports.
AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
SEE ALSO
For a different interface, see File::Temp.
perl v5.10.1 2005-04-22 Arch::TempFiles(3pm)