Loading ...
Sorry, an error occurred while loading the content.

Re: Quoting shell-command

Expand Messages
  • Gadrin
    ... exist), if you do not want ... for this command. ... yes, much nicer. I ve been going entry-by-entry through the glossary, but sometimes when I encounter
    Message 1 of 4 , Sep 24, 2005
    • 0 Attachment
      > Try the following, no shell, no O/S dependence, no messing:
      >
      > !force 0x20 file-op "filename"
      >
      > Note the !force here will ignore any failures (i.e. file does not
      exist), if you do not want
      > this behaviour then the macro will bail out if there is a failure.
      >
      > file-op does lots of other things too so look at the manual page
      for this command.
      >
      > Jon.

      yes, much nicer.

      I've been going entry-by-entry through the glossary, but sometimes
      when I encounter something interesting...I jump around a bit.

      thanks Gadrin
    • Thomas Hundt
      Since when does the DEL command take forward slashes? set-variable #l0 &sprintf del %s%s%s &itoa 34 c: foo.lst &itoa 34 ml-write #l0 shell-command #l0
      Message 2 of 4 , Sep 24, 2005
      • 0 Attachment
        Since when does the DEL command take forward slashes?

        set-variable #l0 &sprintf "del %s%s%s" &itoa 34 "c:\\foo.lst" &itoa 34
        ml-write #l0
        shell-command #l0

        Seems to work.

        -Th

        Gadrin wrote:

        >I've been trying to figure out how to delete a file from within a
        >macro.

        >set-variable %cmd &sprintf "del %s%s%s" &itoa 34 "c:/program
        >files/jasspa/microemacs/junk.txt" &itoa 34
        >ml-write %cmd
        >shell-command %cmd
        >!abort
      Your message has been successfully submitted and would be delivered to recipients shortly.