Currently I am executing run scripts using perl system by sshing into a remote machine:
system("ssh -t remote $dir/bashscript> $dir/stdout.stdout 2> $dir/stderr.stderr &");
I want to pass an environment variable to the bashscript on my remote machine (a directory to be specific). What is the best way to do it? And what should I add in my bashscript to accept the argument?