开发者

setting variables

开发者 https://www.devze.com 2023-04-11 21:47 出处:网络
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 t

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号