code: def escape_filename_sh_ansic(name):
      
  
      out =[]
      # gather the escaped characters into a list
      for ch in name:
          if ord(ch) < 32:
              out.append("\\x%02x"% ord(ch))
          elif ch == '\\':
              out.append('\\\\')
          else:
              out.append(ch)
  
      # slap them back together in an ansi-c quote  $'...'
      return "$'" + "".join(out) + "'"
docs: Return an ansi-c shell-escaped version of a filename.