setting variables
hello I am trying to set two files to variables, does anyone know how I would do this? This code finds duplicate file names and then prints them if they are the same. But I need to be able to delete them and get the pathname. Thanks
find -type f -exec md5sum '{}' ';' | sort | uniq --all-repeated=separate -w 33 | cut -c 35-
So basically I have this md5sum | filename in a file. I am reading and finding the duplicates based开发者_Python百科 on the md5sum. However I may also want to delete the duplicate and print the filepath. Any suggstions?
Just assign to a variable, nothing special needed:
$ X="myFile.py"
$ echo $X
myFile.py
I'm not quite clear, but I think you want to use a read loop:
ComplexFindCommand | while read PATHNAME ; do
echo "This pathname is $PATHNAME"
done
精彩评论