Hmm.... i tried that and i don't think it works... its also causing a new problem. I'll post my entire script so it is easier to see what I'm doing.
Code:
#!
#
#This script will search out duplicate files and remove duplicates
#
#directory=NULL
#echo "Wht directory would you like to remove duplicates from?"
#read directory
cd ~/Desktop/test_remove
for i in *
do
for j in *
do
if [ "$i" != "$j" ]
then
cmp -s -- "$i" "$j"
c=$?
if [ $c == 0 ]
then
if [ "$j" > "$i" ]
then
rm "$j"
else
rm "$i"
fi
fi
fi
done
done
exit 1
The new problem i'm having is some of the duplicates are no longer getting deleted but rather the files are just being emptied. i'm using a folder full of varying text files (some duplicates some not) but some of the duplicates are being returned with the text being missing since i've added the --
Last edited by Franklin52; 10-10-2009 at 08:00 AM..
Reason: Please use code tags!!
I have a process run weekly where I must convert data formats for about thirty files. I read a text file that provides all of the filenames and switch settings.
My perl code is:
for ($j = 1; $j <= $k; $j++)
{
open(FIN2,$fin2) || die "open: $!";
do other stuff
}
Every once in... (2 Replies)
Ok, I have this script that will look for files with the .pl4 extension and rename them with the modification date... But it breaks when the file has a space in it... (files are on windows machine) ive been trying to fix it but no luck.... Any help is greatly appriciated..
#! /bin/sh
for file... (1 Reply)
Hi,
What's the best way to find all files under a directory - including ones with space - in order to apply a command to each of them. For instance I want get a list of files under a directory and generate a checksum for each file.
Here's the csh script:
#!/bin/csh
set files = `find $1... (5 Replies)
Hi ,
My requirement is that i need to search for a number of strings in a log file and print them with line numbers.The search should be date wise.
The sample log file is :
Jan 17 02:45:34 srim6165 MQSIv500: (UKBRKR1P_B.LZ_
BENCHMARKS)BIP2648E: Message backed out to a queue; node... (6 Replies)
Hi
I am a newbie to unix. I have a current script that reads a directory for excel files and renames the files. There is a problem now because some of the files have spaces. If I put quotes on the file, it will work but I dont know how to read all the files with quotes.
Variables
$1 =... (6 Replies)
Hello, I am working on a coding project for a class and to test the program I have created, I have come up with 100 different test cases. The program takes four text files as input, so each of the test cases is contained in a folder with four files.
I have a folder called 'tests', within which... (1 Reply)
I write this bit of code to calculate the mean and variance for all the files in one directory and print the mean and variance in a separate folder but with the same file name.
FILES="data/*"
for X in $FILES
do
name=$(basename $X)
awk '{x=$0; s+=$0; n++}
END{mean=s/n; for (i in x){ss... (20 Replies)
Korn Shell
I have hundreds of small files like below created every day. A midnight cron job moves them to the location /u04/temp/logs
But sometimes I have to manually move these files based a certain dates or time.
I have two basic requirements
1.Using mv command I want to move all .dat... (2 Replies)
I'm trying to search for all files in directory with particular GID then change the GID to match the UID of each file:
#!/bin/sh
for i in $(find /dump -gid 200 | sed 's/\ /\\\ /g' | sed 's/\&/\\\&/g'); do
chgrp $(ls -ln ${i} | awk '{print $3}') ${i}
done
I'm using sed to deal with... (7 Replies)
The following command to replace text in place in multiple files in a directory is tripping up on filename spaces (Windows environment). I really don't know Perl.
find '\\server\directory' | xargs perl -pi -e 's/textA/textB/g'Mike (2 Replies)
Discussion started by: Michael Stora
2 Replies
LEARN ABOUT DEBIAN
rc2po
rc2po(1) Translate Toolkit 1.9.0 rc2po(1)NAME
rc2po - convert .rc files to Gettext PO localization files
SYNOPSIS
rc2po [--version] [-h|--help] [--manpage] [--progress PROGRESS] [--errorlevel ERRORLEVEL] [-i|--input] INPUT [-x|--exclude EXCLUDE]
[-o|--output] OUTPUT [-t|--template TEMPLATE] [-P|--pot] [--charset CHARSET] [-l|--lang LANG] [--sublang SUBLANG] [--duplicates DUPLICAT-
ESTYLE]
OPTIONS --version
show program's version number and exit
-h/--help
show this help message and exit
--manpage
output a manpage based on the help
--progress
show progress as: dots, none, bar, names, verbose
--errorlevel
show errorlevel as: none, message, exception, traceback
-i/--input
read from INPUT in nls, rc formats
-x/--exclude
exclude names matching EXCLUDE from input paths
-o/--output
write to OUTPUT in po, pot formats
-t/--template
read from TEMPLATE in nls, rc formats
-P/--pot
output PO Templates (.pot) rather than PO files (.po)
--charset
charset to use to decode the RC files (default: cp1252)
-l/--lang
LANG entry (default: LANG_ENGLISH)
--sublang
SUBLANG entry (default: SUBLANG_DEFAULT)
--duplicates
what to do with duplicate strings (identical source text): merge, msgctxt (default: 'msgctxt')
Translate Toolkit 1.9.0 rc2po(1)