Rushyang
August 10th, 2010, 07:51 PM
1) I'm making a script, which will prompt all 0 BYTE (EMPTY) files (from specific directory to it's all subdirectories).. and then will ask to whether to delete a file or not.. one by one..
in which I was successful to find all empty files by command..
$find . -empty But I am not able to figure out how to pipe those outcomes with rm command.
if to make a temp file and then store those outcomes into it.. but how to point out (traverse) a variable from file?
3) If I do below...
$img=myimage.jpg
$echo ${img/.jpg/}
myimage (OUTPUT)
So it will trim .jpg extension from backward...
what if I want to trim my selected words or specific positions? (I don't if trim is correct word to explain what I want to do..)
in which I was successful to find all empty files by command..
$find . -empty But I am not able to figure out how to pipe those outcomes with rm command.
if to make a temp file and then store those outcomes into it.. but how to point out (traverse) a variable from file?
3) If I do below...
$img=myimage.jpg
$echo ${img/.jpg/}
myimage (OUTPUT)
So it will trim .jpg extension from backward...
what if I want to trim my selected words or specific positions? (I don't if trim is correct word to explain what I want to do..)