FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 01-04-2012, 07:26 AM
Paul Allen Newell
 
Default dumb question

On 1/4/2012 12:19 AM, Ed Greshko wrote:

On 01/04/2012 04:17 PM, Paul Allen Newell wrote:

Though I can't stand the MS world of extensions meaning something, I
can't imagine not using extensions to help understand what is there.
The system shouldn't give a damn, but the user needs all the help
he/she can get (smile)

Sure, and if someone chooses to use them that is their choice. I don't
bash (pun intended) them for it. I just make sure that the new people I
run into (at work) know that it isn't necessary.

Fair enough ... I understand. If I worked at your place, I would panic
at not having the extensions as a "text-based" clue. I spent too many
years at too many places to understand that seeing an extension on a
file gave me a sense of what the original author intended when I had to
dive into a debug to figure out what he/she screwed up.


But, as I started with, "fair enough" .. I accept and understand,
Paul

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 07:28 AM
Ed Greshko
 
Default dumb question

On 01/04/2012 04:22 PM, Paul Allen Newell wrote:
> And that's the confusion on my end. You are stating that Marvin says
> "make it +x" and you are saying it doesn't need to be. I asked this
> dumb question to find out how I should treat this situation regardless
> of "what works". Its about understanding whether a makefile is an
> executable or if make is just treating it as input and the executable
> part is under the hood.

No.... I'm saying that Marvin first said that the Makefile should be +x
but later corrected himself to say that it was /usr/bin/make he was
thinking of and that certainly needs to be +x because it is the
executable....

[egreshko@f16-2 egreshko]$ file /usr/bin/make
/usr/bin/make: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped

Again, "Makefile" or "makefile" need not be executable and in fact they
aren't meant to be executable.

[egreshko@misty transcode-1.0.2]$ chmod +x Makefile
[egreshko@misty transcode-1.0.2]$ ./Makefile
./Makefile: line 19: srcdir: command not found
./Makefile: line 20: top_srcdir: command not found
./Makefile: line 22: datadir: command not found
./Makefile: line 22: pkgdatadir: command not found
./Makefile: line 23: libdir: command not found
./Makefile: line 23: pkglibdir: command not found
./Makefile: line 24: includedir: command not found

--
A common mistake that people make when trying to design something
completely foolproof was to underestimate the ingenuity of complete
fools. -- Douglas Adams in "Mostly Harmless
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 07:30 AM
Steve Searle
 
Default dumb question

Around 08:17am on Wednesday, January 04, 2012 (UK time), Paul Allen Newell scrawled:

> On 1/4/2012 12:11 AM, Ed Greshko wrote:
> >FWIW, I never use extensions.
> Ed:
>
> Though I can't stand the MS world of extensions meaning something, I
> can't imagine not using extensions to help understand what is there. The
> system shouldn't give a damn, but the user needs all the help he/she can
> get (smile)

The case against extensions in this context is that the user shouldn't
have to change if the shell script is rewritten in a different language.
Having to change from foobar.sh to foobar.pl just because of this change
isn't user friendly. And what if you re-wrote it in C?

But although you can make a case, it isn't an open and shut one, but a
matter of preference I guess. And I certainly think .conf on a file is
useful. And maybe even .d

Steve

--

Website: www.stevesearle.com
Twitter: @ReddishShift
Facebook: www.facebook.com/steve.searle

08:26:23 up 4 days, 19:32, 1 user, load average: 0.08, 0.02, 0.01
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 07:32 AM
Ed Greshko
 
Default dumb question

On 01/04/2012 04:26 PM, Paul Allen Newell wrote:
> air enough ... I understand. If I worked at your place, I would panic
> at not having the extensions as a "text-based" clue. I spent too many
> years at too many places to understand that seeing an extension on a
> file gave me a sense of what the original author intended when I had
> to dive into a debug to figure out what he/she screwed up.
>
> But, as I started with, "fair enough" .. I accept and understand,

Well, I'm sorry you'd panic....

We'd just use the "file" command to find out what the intended use is
and adhere to a standard of putting #!/bin/bash or whatever shell as the
first line of a file...

[egreshko@misty bin]$ file killfox
killfox: Bourne-Again shell script text executable

[egreshko@misty bin]$ file ptest
ptest: perl script text executable

etc....

--
A common mistake that people make when trying to design something
completely foolproof was to underestimate the ingenuity of complete
fools. -- Douglas Adams in "Mostly Harmless
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 07:32 AM
Paul Allen Newell
 
Default dumb question

On 1/4/2012 12:28 AM, Ed Greshko wrote:

On 01/04/2012 04:22 PM, Paul Allen Newell wrote:

And that's the confusion on my end. You are stating that Marvin says
"make it +x" and you are saying it doesn't need to be. I asked this
dumb question to find out how I should treat this situation regardless
of "what works". Its about understanding whether a makefile is an
executable or if make is just treating it as input and the executable
part is under the hood.

No.... I'm saying that Marvin first said that the Makefile should be +x
but later corrected himself to say that it was /usr/bin/make he was
thinking of and that certainly needs to be +x because it is the
executable....

[egreshko@f16-2 egreshko]$ file /usr/bin/make
/usr/bin/make: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped

Again, "Makefile" or "makefile" need not be executable and in fact they
aren't meant to be executable.

[egreshko@misty transcode-1.0.2]$ chmod +x Makefile
[egreshko@misty transcode-1.0.2]$ ./Makefile
./Makefile: line 19: srcdir: command not found
./Makefile: line 20: top_srcdir: command not found
./Makefile: line 22: datadir: command not found
./Makefile: line 22: pkgdatadir: command not found
./Makefile: line 23: libdir: command not found
./Makefile: line 23: pkglibdir: command not found
./Makefile: line 24: includedir: command not found


Ed:

My mis-read, thanks for setting me right on this.

I think I get it now

Thanks,
Paul

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 07:38 AM
Paul Allen Newell
 
Default dumb question

[inline]

On 1/4/2012 12:32 AM, Ed Greshko wrote:


Well, I'm sorry you'd panic....


I wish I had qualified that statement with a "smile" ... please allow me
to edit prior comment.




We'd just use the "file" command to find out what the intended use is
and adhere to a standard of putting #!/bin/bash or whatever shell as the
first line of a file...



In my world, nobody wanted to have to run "file" as we believe the
intent of the file should be obvious on a "ls". We tried to never parse
on extension, it was just used as a clue to what the intent was


Thanks,
Paul
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 07:40 AM
Paul Allen Newell
 
Default dumb question

On 1/4/2012 12:30 AM, Steve Searle wrote:


The case against extensions in this context is that the user shouldn't
have to change if the shell script is rewritten in a different language.
Having to change from foobar.sh to foobar.pl just because of this change
isn't user friendly. And what if you re-wrote it in C?

But although you can make a case, it isn't an open and shut one, but a
matter of preference I guess. And I certainly think .conf on a file is
useful. And maybe even .d

Steve



Steve:

As I have stated earlier, my take is that extensions should be a clue as
to what the file has but not something that should be "fixed" as in MS


Thanks,
Paul

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 07:46 AM
Ed Greshko
 
Default dumb question

On 01/04/2012 04:38 PM, Paul Allen Newell wrote:
> [inline]
>
> On 1/4/2012 12:32 AM, Ed Greshko wrote:
>>
>> Well, I'm sorry you'd panic....
>
> I wish I had qualified that statement with a "smile" ... please allow
> me to edit prior comment.

OK.... :-)

>
>
>> We'd just use the "file" command to find out what the intended use is
>> and adhere to a standard of putting #!/bin/bash or whatever shell as the
>> first line of a file...
>>
>
> In my world, nobody wanted to have to run "file" as we believe the
> intent of the file should be obvious on a "ls". We tried to never
> parse on extension, it was just used as a clue to what the intent was
>

Well, we always will put the files/command (end product of compilation)
in directories that tend to clue one in on the purpose. /bin /sbin
/usr/bin, etc. And, we only put +x on the files that really need them.
Hardly ever needing to use the "file" command to determine if the file
is to be executed directly.

Just our way of doing things.


--
A common mistake that people make when trying to design something
completely foolproof was to underestimate the ingenuity of complete
fools. -- Douglas Adams in "Mostly Harmless
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 07:56 AM
Paul Allen Newell
 
Default dumb question

On 1/4/2012 12:46 AM, Ed Greshko wrote:


Well, we always will put the files/command (end product of compilation)
in directories that tend to clue one in on the purpose. /bin /sbin
/usr/bin, etc. And, we only put +x on the files that really need them.
Hardly ever needing to use the "file" command to determine if the file
is to be executed directly.



Ed:

Makes sense ... I think it all falls under different folks finding
conventions that work for them. I do like the idea of only making files
"+x" if needed


Thanks for sharing your POV ... plus resolving my original question,
Paul

Just our way of doing things.




--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 01-04-2012, 11:04 AM
JB
 
Default dumb question

Paul Allen Newell <pnewell <at> cs.cmu.edu> writes:

> ...
> For questions on my syntax of "*.sh", I have believed since my earliest
> days that a shell file (be it ".sh", ".csh", ".tcsh", or ".bash") that
> it has to be "+x" as it is an executable. If I am incorrect, I would
> love to know, though it may take me a day or two to adjust to the news
> that the earth shifted polarity (smile)
>

Sleep well, the polarity is still intact :-)

Would the following be helpful ?

# ls -l /etc/init.d/network
-rwxr-xr-x. 1 root root 7448 Feb 25 2011 /etc/init.d/network

# file /etc/init.d/network
/etc/init.d/network: Bourne-Again shell script text executable

# cat /etc/init.d/network
#! /bin/bash
#
# network Bring up/down networking
#
# chkconfig: - 10 90
# description: Activates/Deactivates all network interfaces configured to
# start at boot time.
#
### BEGIN INIT INFO
# Provides: $network
# Should-Start: iptables ip6tables
# Short-Description: Bring up/down networking
# Description: Bring up/down networking
### END INIT INFO

# Source function library.
. /etc/init.d/functions
...

# /etc/init.d/network status
Configured devices:
lo
Currently active devices:
lo eth0

# sh /etc/init.d/network status
Configured devices:
lo
Currently active devices:
lo eth0

# chmod a-x /etc/init.d/network

# ls -al /etc/init.d/network
-rw-r--r--. 1 root root 7448 Feb 25 2011 /etc/init.d/network

# file /etc/init.d/network
/etc/init.d/network: Bourne-Again shell script text executable

# /etc/init.d/network status
bash: /etc/init.d/network: Permission denied

# sh /etc/init.d/network status
Configured devices:
lo
Currently active devices:
lo eth0

JB

“It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.”
- Mark Twain


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 

Thread Tools




All times are GMT. The time now is 09:00 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org