HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/jed/lib/pipe.sl
variable Last_Process_Command = Null_String;

define process_region ()
{
   variable cmd, tmp_file;
   cmd = read_mini ("Pipe to command:", Last_Process_Command, Null_String);
   ifnot (strlen (cmd)) return;

   Last_Process_Command = cmd;

   tmp_file = make_tmp_file ("/tmp/jedpipe");
   cmd = strncat (cmd, " > ", tmp_file, " 2>&1", 4);

   ifnot (dupmark ()) error ("Mark not set.");

   if (pipe_region (cmd))
     {
	error ("Process returned a non-zero exit status.");
     }
   del_region ();
   () = insert_file (tmp_file);
   () = delete_file (tmp_file);
}