1

I could not delete the extra white space around a .eps file in Ubuntu 12.04. I have done the same, using the command fixbb <inputfile.eps> <outputfile.eps> in earlier versions but in this version, whenever I try, I get the messeage fixbb:command not found.

IronMan007
  • 157
  • 1
  • 2
  • 12

1 Answers1

0

you can do simple scripting for doing that

   ls | grep " " | while read -r file_name ; do mv -v "$file_name" `echo $file_name | tr -d ' '` ; done

before doing that you need to enter into that directory then execute the script.

you can also use alias here to call it with out using whole command everytime.

in the terminal do as ,

nano ~/.bashrc

and in that text file at the last place paste the above script as

alias fixb='ls | grep " " | while read -r file_name ; do mv -v "$file_name" `echo $file_name | tr -d ' '` ; done'

then save and close with CTRL+X & Y.

now in the terminal type as

source ~/.bashrc 

to reload the bashrc file. now you can simply remove all the spaces.

Raja G
  • 100,643
  • 105
  • 254
  • 328
  • Thank you very much for your answer. I did everything but when in the terminal i typed the command source ~/.bashrc the following message was displayed bash: alias: | while read -r file_name ; do mv -v ; done: not found – RANJIB BANERJEE Apr 09 '13 at 14:50
  • 1
    I think there has been some confusion here - the `fixbb` command referred to by the original poster is almost certainly a Ghostscript script to modify the bounding box around an image file - nothing to do with removing whitespace from file*names*. FYI an implementation of the `fixbb` script seems to be available from the gnuplot website http://www.gnuplot.info/scripts/ (although I can't be sure that is exactly the script you used before). – steeldriver Nov 28 '13 at 13:49