tracker issue : CF-4126651

select a category, or use search below
(searches all categories and all time range)
Title:

Cannot use /usr/bin/env to create executable

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Sean Corfield / Sean Corfield (Sean Corfield)

Created: 03/09/2016

Components: CLI

Versions: 2016

Failure Type: Unspecified

Found In Build/Fixed In Build: Alpha_v12 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Mac All

Vote Count: 1

Problem Description:

A common trick with other languages is to write a shell script using #!/usr/bin/env that accepts the rest of the shell script as input and runs it using the specified language interpreter. This does not work with Raijin's CLI.

Steps to Reproduce:

Create test.sh containing this code, and make it executable:

#!/usr/bin/env cf.sh
<cfoutput>
Hello Shell Script!
</cfoutput>

Ensure cf.sh is on your path. Run the shell script:

./test.sh

Actual Result:

(! 823)-> ./test.sh 
Usage:
cfcli.bat <absolute or relative path of cfm> <positional arguments and/or named arguments, if any> -outputdir=<output directory> -logdir=<log directory>

Example1: cfcli.bat C:\Project\hello.cfm
Example2: cfcli.bat C:\Project\hello.cfm foo
Example3: cfcli.bat C:\Project\hello.cfm name=bar
Example4: cfcli.bat C:\Project\hello.cfm foo name=bar
Example5: cfcli.bat C:\Project\hello.cfm -outputdir=C:\Project\classes
Example6: cfcli.bat C:\Project\hello.cfm -logdir=C:\Project\logs
Example7: cfcli.bat C:\Project\hello.cfm -outputdir=C:\Project\classes -logdir=C:\Project\logs
Example8: cfcli.bat C:\Project\hello.cfm foo name=bar -outputdir=C:\Project\classes -logdir=C:\Project\logs


Thu Aug 06 15:47:33
(sean)-(jobs:0)-(~/cfml)

Expected Result:

(! 823)-> ./test.sh 
Hello Shell Script!

Thu Aug 06 15:47:33
(sean)-(jobs:0)-(~/cfml)

Any Workarounds:

None. You have to explicitly invoke the CLI with the path to a bare .cfm file.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4126651

External Customer Info:
External Company: Railo US
External Customer Name: Sean Corfield
External Customer Email: SEAN@CORFIELD.ORG
External Test Config:

Attachments:

Comments:

Adding BUG AUDIT TRAIL ********action: updated fieldName: Fix By Product Milestone newValue: Alpha oldValue: Beta oprid: rukumar recordName: RQ_DEFECT timpestamp: 2015-10-27 06:51:46.0 action: updated fieldName: Fix By Milestone newValue: Alpha oldValue: Beta oprid: rukumar recordName: RQ_DEFECT timpestamp: 2015-10-27 06:51:46.0 action: updated fieldName: Priority newValue: 2 oldValue: 0 oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2015-09-10 04:06:35.0 action: updated fieldName: Severity newValue: 0 oldValue: 3 oprid: himar recordName: RQ_DEFECT timpestamp: 2015-08-18 10:29:07.0 action: updated fieldName: Owner newValue: himar oldValue: rukumar oprid: himar recordName: RQ_DEFECT timpestamp: 2015-08-14 10:26:38.0 action: updated fieldName: Status newValue: ToFix oldValue: NeedsReview oprid: himar recordName: RQ_DEFECT timpestamp: 2015-08-14 10:26:38.0 action: updated fieldName: Reason newValue: Investigate oldValue: Blank oprid: himar recordName: RQ_DEFECT timpestamp: 2015-08-14 10:26:38.0 action: updated fieldName: Reason newValue: Blank oldValue: Blank oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-08-14 04:14:26.0 action: updated fieldName: Status newValue: NeedsReview oldValue: Unverified oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-08-14 04:14:26.0 action: updated fieldName: Fix By Product Milestone newValue: Beta oldValue: Blank oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-08-14 04:14:26.0 action: updated fieldName: Fix By Milestone newValue: Beta oldValue: Blank oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-08-14 04:14:26.0 action: updated fieldName: Owner newValue: rukumar oldValue: hkallae oprid: hkallae recordName: RQ_DEFECT timpestamp: 2015-08-14 04:14:26.0 action: added fieldName: Vote Type newValue: BETA oldValue: Blank oprid: prerelease recordName: AD_DEFECT_VOTE timpestamp: 2015-08-07 11:22:32.0
Comment by CFwatson U.
3605 | March 09, 2016 04:25:33 AM GMT
+1 Please explain how this bug or feature impacts your productivity and why you are adding your vote
Vote by External U.
3610 | March 09, 2016 04:25:34 AM GMT
Added By:rukumar Note Added: This would be taken up for the next version Date Added :2015-10-27 06:51:46.0 Added By: PreRelease User User Name:Sean Corfield Note Added: Verified still open. Date Added :2015-09-15 21:11:43.0 Added By: PreRelease User User Name:Adam Cameron Note Added: +1 Date Added :2015-08-07 11:22:17.0 Added By: PreRelease User User Name:Sean Corfield Note Added: Just FYI, if you name the shell script with a .cfm suffix it works. That is not necessary with other languages such as Python. I think the CLI should accept files that do not end in .cfm and just assume they _are_ CFML. Date Added :2015-08-06 23:02:23.0 Added By: PreRelease User User Name:Sean Corfield Note Added: Entered Bug. Date Added :2015-08-06 22:52:14.0
Comment by CFwatson U.
3606 | March 09, 2016 04:25:35 AM GMT
I hope this will be taken up (and fixed) in Aether?
Comment by Sean C.
3607 | September 22, 2017 07:19:37 PM GMT
Yes, it is currently in the pipeline for Aether.
Comment by Vamseekrishna N.
3608 | September 25, 2017 05:15:06 AM GMT
Excellent! Thank you!
Comment by Sean C.
3609 | September 25, 2017 05:19:57 PM GMT