5 Replies Latest reply: Jan 16, 2009 6:32 AM by druet
druet Level 1 (0 points)
I need information on how to save a file while in a Terminal session. I'm running 10.5.6, and there is not an option to save as in the settings windows as I had on previous versions of OS X.

iMac, Mac OS X (10.5.6)
  • tomvons Level 1 (0 points)
    You'll need to give more details, what are you doing with the file that it needs to be saved from the terminal?
  • druet Level 1 (0 points)
    Thansk for the quick reply. Below is my problem and solution I was given. The part I need help with in in the fix...how do I "Save and exit the file".

    Problem: When printing a job from quarkxpress 7.3 with duplex selected the job will print single sided instead of duplex.

    -Open Terminal
    -Edit the mime.convs file like so: sudo vi /etc/cups/mime.convs
    -Before the line application/pdf.... enter this on it's own line: application/quark-ps application/vnd.cups-postscript 33 pstops
    -Save and exit the file
    -Restart the CUPS print system with this command: sudo killall HUP cupsd

    Background info

    When Quark prints a job they set a mime type which isn't supported by the OS and on 10.5 it appears there isn't a catch-all mime-type processor whereas on 10.4 there is. The default mime-type processor is pstops which converts printer independent PostScript into printer dependent PostScript, basically adding in the PPD keywords to the PostScript stream.

    The patch from Quark sets a new mime type in the file /etc/cups/mime.convs which points to the CUPS filter quarkpstops. This filter is a shell script which reads from standard input and writes to standard output, no processing is done. Our filter is run but the items in question, media color and type, are part of the PPD and normally placed in the PostScript stream by the pstops filter.

    So long story longer, to fix this behavior we can replace the line Quark adds to the mime.convs file and produce PostScript which contains our PPD keywords. Nothing else should be impacted based on watching what happens with the Quark filter in place.
  • tomvons Level 1 (0 points)
    Ah, I see the problem. You're being told to type "*sudo vi /etc/cups/mime.convs*", this breaks down to:

    sudo: run the command as a super-user
    vi: a somewhat cryptic text editor if you aren't familiar with it
    /etc/cups/mime.convs: the file to edit, of course

    Instead of opening the file with "vi", try using "nano" which is much friendlier. So, run "*sudo nano /etc/cups/mime.convs*" make your edits and hit ctrl-x to exit (it will ask you if you want to save and what file name, just hit Y to save and hit enter when it asks the filename, it should default to the right thing).

    By the way, if you find yourself stuck in "vi", you can exit it by hitting escape and typing ":q" (quit), or ":wq" (write/save file and quit). If you're really stuck, use ":q!" (quit without saving).

    (I don't know anything about your Quark problem, so I'm assuming the instructions you were given are correct)
  • druet Level 1 (0 points)
    ****, you're good :o)

    Thanks so much for your help!
  • BobHarris Level 6 (17,010 points)
    If you do not know how to use vi (or Vim), then try nano as your text editor.

    sudo nano /etc/cups/mime.convs

    Or even better. Download the free TextWrangler from Bare Bones Software. It can edit text files such as /etc/cups/mime.convs in a GUI environment with menus and all the stuff you are used to.

    If you really want to use vi then try


    as in : says use an ex command, w says write, q says quit.

    NOTE: I love vi/Vim as a text editor. I get paid a lot of money to write code, and vi/Vim is my preferred editor. It is VERY powerful. HOWEVER it is a lousy beginner to the command line text editor. Whoever wrote those editing instructions was not thinking about who would need to use them. nano would have been a much better choice.