Unix scripts not working in 10.8.2

61 views
Skip to first unread message

John Delacour

unread,
Oct 5, 2012, 3:43:52 PM10/5/12
to bbe...@googlegroups.com

I installed Mountain Lion yesterday, probably the worst decision I ever
made! Some of Apple�s own main apps now seem to be buggier than they
were 5 years ago with no useful new features.

None of my UNIX filters in BBEdit are now working.

For example this script

#!/usr/bin/perl
while (<>) {
print "* $_"
}

should put an asterisk at the beginning of each line in the front
document but nothing happens at all with this script or any other.

Mountain Lion has caused me so much trouble that I�m now exhausted, so
perhaps I�m missing something obvious.

Any help out there?

JD

François Schiettecatte

unread,
Oct 5, 2012, 3:52:08 PM10/5/12
to bbe...@googlegroups.com
Dumb question, have you checked that the script has execute permissions?

chmod 755 myScript.pl


François

On Oct 5, 2012, at 3:43 PM, John Delacour <johnde...@gmail.com> wrote:

>
> I installed Mountain Lion yesterday, probably the worst decision I ever made! Some of Apple’s own main apps now seem to be buggier than they were 5 years ago with no useful new features.
>
> None of my UNIX filters in BBEdit are now working.
>
> For example this script
>
> #!/usr/bin/perl
> while (<>) {
> print "* $_"
> }
>
> should put an asterisk at the beginning of each line in the front document but nothing happens at all with this script or any other.
>
> Mountain Lion has caused me so much trouble that I’m now exhausted, so perhaps I’m missing something obvious.
>
> Any help out there?
>
> JD
>
> --
> --
> You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbe...@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+un...@googlegroups.com
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem, please email "sup...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
>
>
>

Doug McNutt

unread,
Oct 5, 2012, 4:54:41 PM10/5/12
to bbe...@googlegroups.com
At 20:43 +0100 10/5/12, John Delacour wrote:
>I installed Mountain Lion yesterday, probably the worst decision I ever made! Some of Apple's own main apps now seem to be buggier than they were 5 years ago with no useful new features.
>
>None of my UNIX filters in BBEdit are now working.
>
>For example this script
>
>#!/usr/bin/perl
>while (<>) {
>print "* $_"
>}
>
>should put an asterisk at the beginning of each line in the front document but nothing happens at all with this script or any other.
>
>Mountain Lion has caused me so much trouble that I'm now exhausted, so perhaps I'm missing something obvious.
>
>Any help out there?
>
>JD

You might need a semicolon after the print, But it is the last line between {}s so whonoze?

Apple thinks UNIX users are out to destroy their machines.

Others, in the SciTech area, have reported that many UNIX executables have been moved from /usr/bin/ to something like /usr/share/bin/... though Apple itself uses perl so perhaps not.

Check which perl top see if a usable perl is found with your $PATH and your path might not be what you think when calling from within bbedit.


--

--> From the U S of A, the only socialist country that refuses to admit it. <--

François Schiettecatte

unread,
Oct 5, 2012, 5:19:05 PM10/5/12
to bbe...@googlegroups.com
Good point about the semi-colon, I missed that (too much python).

FWIW it is good practice to use :

#!/usr/bin/env perl

rather than:

#!/usr/bin/perl

At the start of your script, so that perl can be found if it is relocated.

François

John Delacour

unread,
Oct 5, 2012, 5:53:29 PM10/5/12
to bbe...@googlegroups.com
On 05/10/2012 21:54, Doug McNutt wrote:
> At 20:43 +0100 10/5/12, John Delacour wrote:
>> None of my UNIX filters in BBEdit are now working.
>>
>> For example this script
>>
>> #!/usr/bin/perl
>> while (<>) {
>> print "* $_"
>> }
>>
>> should put an asterisk at the beginning of each line in the front document but nothing happens at all with this script or any other.
> You might need a semicolon after the print, But it is the last line between {}s so whonoze?
I said _none_ of the UNIX scripts were working, not that I doubted my
ability to write a simple Perl script! In fact a semi-colon in this
position is redundant, though I could add ;;; without breaking it.

I have discovered the reason, and that is that BB have rearranged the
files in the Application Support folder. The UNIX filters and scripts
should have been moved to ../BBEdit/Text Filters/ but they have been
moved to ../BBEdit/Scripts/Text Filters/, and that's why they weren�t
working. I found this out by RTFM p.34.

JD


John Delacour

unread,
Oct 6, 2012, 4:53:17 PM10/6/12
to bbe...@googlegroups.com
On 05/10/2012 20:52, Fran�ois Schiettecatte wrote:
> Dumb question, have you checked that the script has execute permissions?
> chmod 755 myScript.pl
I�ve explained why the scripts weren�t working, and it has nothing to do
with permissions. A script does not need to be executable in this
environment.

JD

Doug McNutt

unread,
Oct 6, 2012, 5:15:17 PM10/6/12
to bbe...@googlegroups.com
At 21:53 +0100 10/6/12, John Delacour wrote:
>On 05/10/2012 20:52, Fran�ois Schiettecatte wrote:
>>Dumb question, have you checked that the script has execute permissions?
>> chmod 755 myScript.pl
>I've explained why the scripts weren't working, and it has nothing to do with permissions. A script does not need to be executable in this environment.
>
>JD

That's interesting.

Does bbedit read and translate the shebang line then? What about

#!/usr/bin/myspecialbinary

Would bbedit execute my compiled code in $HOME/bin if I tried to run it as a bbedit script? What about

#!/Users/doug/bin/tcsh ?

Or does the script have to be written in perl?
--

--> Halloween == Oct 31 == Dec 25 == Christmas <--
Reply all
Reply to author
Forward
0 new messages