Difference: PatasShebangLines (1 vs. 12)

Revision 122011-08-22 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 38 to 38
  #!/usr/bin/ruby
Added:
>
>

Ruby 1.9.x

#!/opt/ruby-1.9/bin/ruby

 

Portable Shebang

When developing scripts in other environments with final testing (and submission of homework) on patas, you may find that your development environment has the desired script binary in one place, and patas has the script binary in another. For example, you need to manually edit the shebang line on your perl scripts every time you move the perl script to patas. One way to get around this is to use /usr/bin/env to find the path for your target script program, in this case perl.

Revision 112010-10-05 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 25 to 25
 

Python 2.6.x

#!/opt/python-2.6/bin/python2.6

Added:
>
>

Python 2.7

 
Added:
>
>
#!/opt/python-2.7/bin/python2.7
 

Python 3.0

#!/opt/python-3.0/bin/python3.0

Added:
>
>

Python 3.1

 
Added:
>
>
#!/opt/python-3.1/bin/python3.1
 

Ruby 1.8.5

#!/usr/bin/ruby

Revision 102010-02-16 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 64 to 64
  and the local path for perl will automatically be substituted.
Added:
>
>
Important: If you use this technique with Condor, you must include getenv = true in your Condor submit script; otherwise there won't be a valid PATH variable for /usr/bin/env to work with.
 NB: to make sure you are using the same version of perl in both environments, run which perl on each. If your devel version of perl doesn't match the version on patas, fiddle with your PATH environment variable so the proper version is found, or create a link in your local /bin, /usr/bin, or /usr/local/bin to the proper version of perl on your devel machine.

Use of /usr/bin/env is a Good Thing in shebang lines, as it eliminates a lot of manual changes when doing cross-platform script development. And yes Virginia, it will work fine for python and ruby as well.

Deleted:
<
<
-- brodbd - 17 Sep 2009

Revision 92010-02-15 - jscott42

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 26 to 31
  #!/opt/python-3.0/bin/python3.0

Ruby 1.8.5

Added:
>
>
  #!/usr/bin/ruby
Added:
>
>

Portable Shebang

When developing scripts in other environments with final testing (and submission of homework) on patas, you may find that your development environment has the desired script binary in one place, and patas has the script binary in another. For example, you need to manually edit the shebang line on your perl scripts every time you move the perl script to patas. One way to get around this is to use /usr/bin/env to find the path for your target script program, in this case perl.

For example, you may see the following for the location of perl 5.10 on patas and your devel machine:

patas: /opt/perl/bin/perl 

    jscott42@patas:~$ which perl 
    /opt/perl/bin/perl

    jscott42@patas:~$ perl --version
    This is perl, v5.10.0 built for x86_64-linux

mymachine (hani-winxp): /usr/bin/perl
 
    jeffry@hani-winxp ~ $ which perl
    /usr/bin/perl

    jeffry@hani-winxp ~ $ perl --version
    This is perl, v5.10. (*) built for i686-cygwin-thread-multi-64int
    (with 12 registered patches, see perl -V for more detail)

Replace your shebang line in your perl scripts to read:

#!/usr/bin/env perl

and the local path for perl will automatically be substituted.

NB: to make sure you are using the same version of perl in both environments, run which perl on each. If your devel version of perl doesn't match the version on patas, fiddle with your PATH environment variable so the proper version is found, or create a link in your local /bin, /usr/bin, or /usr/local/bin to the proper version of perl on your devel machine.

Use of /usr/bin/env is a Good Thing in shebang lines, as it eliminates a lot of manual changes when doing cross-platform script development. And yes Virginia, it will work fine for python and ruby as well.

 -- brodbd - 17 Sep 2009 \ No newline at end of file

Revision 82009-09-17 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 19 to 19
 

Python 2.5.x

#!/opt/python-2.5/bin/python2.5
Changed:
<
<

Python 2.6

>
>

Python 2.6.x

  #!/opt/python-2.6/bin/python2.6

Python 3.0

Line: 28 to 28
 

Ruby 1.8.5

#!/usr/bin/ruby
Deleted:
<
<
-- brodbd - 15 Dec 2008
 \ No newline at end of file
Added:
>
>
-- brodbd - 17 Sep 2009
 \ No newline at end of file

Revision 72009-01-02 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 13 to 13
  (Note: The distribution perl at /usr/bin/perl does not have the linguistics-specific modules installed.)
Changed:
<
<

Python 2.4.x (deprecated)

>
>

Python 2.4.x (deprecated, no longer maintained)

  #!/usr/bin/python

Python 2.5.x

Revision 62008-12-15 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 8 to 8
  #!/bin/bash
Changed:
<
<

Perl v5.8.8

>
>

Perl v5.10.0

  #!/opt/perl/bin/perl

(Note: The distribution perl at /usr/bin/perl does not have the linguistics-specific modules installed.)

Line: 28 to 28
 

Ruby 1.8.5

#!/usr/bin/ruby
Changed:
<
<
-- brodbd - 05 Dec 2008
>
>
-- brodbd - 15 Dec 2008
 \ No newline at end of file

Revision 52008-12-05 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 13 to 13
  (Note: The distribution perl at /usr/bin/perl does not have the linguistics-specific modules installed.)
Changed:
<
<

Python 2.4.x

>
>

Python 2.4.x (deprecated)

 #!/usr/bin/python

Python 2.5.x

#!/opt/python-2.5/bin/python2.5
Changed:
<
<

Python 2.6.x

>
>

Python 2.6

 #!/opt/python-2.6/bin/python2.6
Added:
>
>

Python 3.0

#!/opt/python-3.0/bin/python3.0
 

Ruby 1.8.5

#!/usr/bin/ruby
Changed:
<
<
-- brodbd - 03 Oct 2008
>
>
-- brodbd - 05 Dec 2008

Revision 42008-10-03 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 19 to 19
 

Python 2.5.x

#!/opt/python-2.5/bin/python2.5
Added:
>
>

Python 2.6.x

#!/opt/python-2.6/bin/python2.6
 

Ruby 1.8.5

#!/usr/bin/ruby
Changed:
<
<
-- DavidBrodbeck - 04 Dec 2007
>
>
-- brodbd - 03 Oct 2008
 

Revision 32008-01-02 - DavidBrodbeck

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 9 to 9
 #!/bin/bash

Perl v5.8.8

Changed:
<
<
#!/opt/perl/bin/perl or #!/usr/bin/perl
>
>
#!/opt/perl/bin/perl

(Note: The distribution perl at /usr/bin/perl does not have the linguistics-specific modules installed.)

 

Python 2.4.x

#!/usr/bin/python

Revision 22007-12-04 - DavidBrodbeck

Line: 1 to 1
 
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Line: 11 to 11
 

Perl v5.8.8

#!/opt/perl/bin/perl or #!/usr/bin/perl
Changed:
<
<

Python 2.4

>
>

Python 2.4.x

 #!/usr/bin/python

Python 2.5.x

Revision 12007-12-04 - DavidBrodbeck

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="CondorClusterHomepage"

"Shebang" lines for scripts on Patas

Here are the proper script headers for various interpreted languages on patas.

Bash

#!/bin/bash

Perl v5.8.8

#!/opt/perl/bin/perl or #!/usr/bin/perl

Python 2.4

#!/usr/bin/python

Python 2.5.x

#!/opt/python-2.5/bin/python2.5

Ruby 1.8.5

#!/usr/bin/ruby

-- DavidBrodbeck - 04 Dec 2007

 
This site is powered by the TWiki collaboration platformCopyright & by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Privacy Statement Terms & Conditions