[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how execute a script



On Tue, Nov 17, 2015 at 2:57 PM, shawn wilson <ag4ve.us@gmail.com> wrote:
> On Tue, Nov 17, 2015 at 2:53 PM, Brian <ad44@cityscape.co.uk> wrote:
>> On Tue 17 Nov 2015 at 14:05:25 -0500, shawn wilson wrote:
>>
>>> On Tue, Nov 17, 2015 at 1:56 PM, Brian <ad44@cityscape.co.uk> wrote:
>>> > On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote:
>>> >
>>> >> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
>>> >> <cbannister@slingshot.co.nz> wrote:
>>> >> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
>>> >> >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
>>> >> >> > department has been trying for an hour".  Puzzled, because I thought I had
>>> >> >> > sent a .pdf, and had checked that it opened fine in Evince, I looked at
>>> >> >> the
>>> >> >> > file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
>>> >> >>
>>> >> >> communicated (via its extension). If you create a pdf, it is bad to not
>>> >> >> have the pdf extension - you've lost data.
>>> >> >
>>> >> > How have you lost data?
>>> >>
>>> >> You loose what the file type (data) should be if you save a file w/o
>>> >> an extension. Again, this is fine for an installed program (no one
>>> >> cares as long as it works) but not so good for data that is processed
>>> >> by another program or a script I want to edit.
>>> >
>>> > You would have to give a specific example where a file processed by a
>>> > program or script fails to open for this argument to be convincing, You
>>> > also have to distinguish between data in the file and information the
>>> > extension conveys to the program.
>>>
>>> How about just that vim filetype relies on the filename to determine the format?
>>
>> "vim filetype". I don't know what you mean. 'vim /usr/bin/vim' opens the
>> file.  I do not understand a word of the display but it does open it. An
>> extension doesn't seem to have a part to play in the file's opening.
>>
>
> Your way of setting filetype is by looking at the extension - for example:
> :autocmd BufRead *.js set filetype=javascript
>
> Same goes for *.pl or *.pm or *.py or *.c, etc

Here's another example of magic failing:

 % file t.sh

Downloads/temp swlap1
t.sh: ASCII text
 % cat t.sh

Downloads/temp swlap1
max=10

echo "HERE 1"
for (( count = 0; count <= max; count++ )) ; do
  echo "$count"
  sleep "${sleep:-0}"
done
echo "HERE 2"
 % ./t.sh

Downloads/temp swlap1
HERE 1
0
1
2
3
4
5
6
7
8
9
10
HERE 2


Reply to: