Skip to content
faq.rst 1.34 KiB
Newer Older
Michael Krause's avatar
Michael Krause committed
======
Michael Krause's avatar
Michael Krause committed


qsub:  file must be an ascii script
Michael Krause's avatar
Michael Krause committed
-----------------------------------
Michael Krause's avatar
Michael Krause committed

This is mostly a copy and pasting error, especially when working with Microsoft
Word and other "editors".
Qsub jobs need to be in ascii format and cannot handle UTF-8 special characters.
To test if you jobfile/script has special characters you can use the ``file`` command.
Converting can be done with your editor of choice or with the ``iconv`` program.

Example:

.. code-block:: bash

Michael Krause's avatar
Michael Krause committed
   # UTF-8, will probably produce a faulty job file
Michael Krause's avatar
Michael Krause committed
   root@master:$ file MRtrix3_TARDIS_0.3.sh
   MRtrix3_TARDIS_0.3.sh: Bourne-Again shell script, UTF-8 Unicode text executable

   # ASCII, will probably work
   root@master:$ file MRtrix3_preproc.sh
   MRtrix3_preproc.sh: Bourne-A gain shell script, ASCII text executable

Michael Krause's avatar
Michael Krause committed
   # convert from utf-8 to ascii will never work, but tell you the position of
   # the non-ascii character
Michael Krause's avatar
Michael Krause committed
   root@master:$ iconv -f utf-8 -t ascii MRtrix3_TARDIS_0.3.sh
   [...]
   #PBS -j oe
   #PBS iconv: illegal input sequence at position 3811


As you can see in the example above the character after ``#PBS`` following the
line ``#PBS -j oe`` could not be parsed to UTF-8. In this case the hyphen
character ``-`` is a UTF-8 special character instead. Just delete it and
Michael Krause's avatar
Michael Krause committed
replace with an actual hyphen and your script should automatically become an
Michael Krause's avatar
Michael Krause committed
ascii file.