I can’t understand why I am getting “No such file or directory” when using the command
uniq –u $PBS_NODEFILE > /mntnfs/nodes/nodelist.txt
I perform an ls on the folder to make sure the file is there. I can read the source file /var/spool/pbs/aux/249.headnode. Can anyone point out what is going wrong here?
It looks to me like your uniq command isn’t recognizing
–u
as an argument but as a filename.
Did you by chance cut and paste this command from something that honors Unicode and not ascii? (Visually it looks that way to me, but I have no idea if that’s just the formatting of the web page or if the script is like that too). I would double check that the “u” is actually proceeded by a hyphen and not some other kind of Unicode delimiter like an em-dash. I’ve actually had users accidentally cut and paste smileys into scripts before.
If not the first item, are you sure your PATH is pointing to the /bin/uniq or /usr/bin/uniq? Maybe you should have a “which uniq” command to your script. It’s also possible that your PATH in your script environment is running some other command (with the same name) that doesn’t honor the -u argument.
Similar to #2, are you sure the copy of uniq you are invoking honors the -u argument?
I tried the command you reference and it works fine. I’m not sure why the uniq -u or -d will not work with the .SC job file that is created. Any idea why?
Thanks for responding. I don’t spend much time in linux. I didn’t realise there was something called a string array. The $PBS_NODEFILE name may have mislead me then. I just assumed it was a file.
$PBS_NODEFILE points to a file located on the mother superior node ( first node listed in the output of qstat -fx < jobid > | grep -i exec_vnode output ). This file is created dynamically by PBS Pro.
Please try this :
[pbsdata@pbsserver ~]$ qsub -I
qsub: waiting for job 210.pbsserver to start
qsub: job 210.pbsserver ready
I have tested uniq -u $PBS_NODEFILE on my test machine and it worked for me
I suspect the hypen in front of u of the uniq -u command has issues or it must have been copy pasted from a window system , so it might be windows hypen, plese delete that hypen and test it.