I ran into space issues on my machine and therefore the sort command in unix failed because of lack of space in /tmp. In order to circumvent this, I decided to run sort with the -T option allowing it to use some other directory for creating temporary files. here is the perl script I have
my $TMPDIR = "/home/xyz/workspace/";
my $sortCommand = "awk 'NR == 1; NR > 1 { print \$0 | \"sort -T \$TMPDIR -k1,1\" }' test > test.sort";
system_call($sortCommand, "Sort");
sub system_call {
.......
}
this works perfectly on my desktop but when I run this in a different machine I get the error
"sort: cannot create temporary file: -k1,1/sortFoeXZx: No such file or directory"
Any ideas ?