I recommend you to use the Ubuntu Pastebin site to post your code and link it. So you won't lose any character and make it more clear.
–
LucioSep 17 '12 at 20:23

3

What do you expect it to do? Where did you find it? And the errors speak for themselves. You do not have links installed and output is being redirected to $rootdir/, which is not a file, but a directory.
–
gertvdijkSep 17 '12 at 20:23

@gertvdijk from offensivecomputing. I have asked for clarification there too. I should have mentioned that I am not very good in Linux. This script should help me get malware for analysis.
–
Sunil JSep 17 '12 at 21:48

$rootdir/>$filename happened when i tried to format it. Checked and verified that it is showing $rootdir/$filename. the code is pasted at link. now I am getting script.sh: line 11: /usr/share/malware/: Is a directory URL expected after -dump
–
Sunil JSep 17 '12 at 21:54

Well then it appears that $filename does not contain any string when it gets to that line. Put in echo $filename's throughout the file to try to see where it disappears, also check and make sure that that is not a typo (maybe it should be $file or $name or something).
–
Alex L.Sep 18 '12 at 14:26