#!/usr/bin/perl

$i = 0;
for (@ARGV) {
	if (/^;$/) { $command .= '; '; next; }
	if (/^&&$/) { $command .= '&& '; next; }
	if (/^\|\|$/) { $command .= '|| '; next; }
	if (/^\|$/) { $command .= '| '; next; }
	s/"/"'"'"/g;
	s/\$/\\\$/g;
	s/\\\$\+/\$/g;
	$command .= "\"$_\" "
}

while (<STDIN>) {
	chomp($ENV{x} = $_);
	system($command);
}