Kamis, 04 Desember 2014

Bristol Digest, Vol 579, Issue 8

Send Bristol mailing list submissions to
bristol@mailman.lug.org.uk

To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.lug.org.uk/mailman/listinfo/bristol
or, via email, send a message with subject or body 'help' to
bristol-request@mailman.lug.org.uk

You can reach the person managing the list at
bristol-owner@mailman.lug.org.uk

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Bristol digest..."


Today's Topics:

1. Re: Are all Nano's the same!? (Peter Hemmings)
2. Re: Are all Nano's the same!? (Shane McEwan)
3. Re: Are all Nano's the same!? (Alex Butcher (LUG))
4. Re: Are all Nano's the same!? (Peter Hemmings)
5. Re: Are all Nano's the same!? (Peter Hemmings)


----------------------------------------------------------------------

Message: 1
Date: Thu, 04 Dec 2014 15:19:47 +0000
From: Peter Hemmings <peter@hemmings.eclipse.co.uk>
To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
Subject: Re: [bristol] Are all Nano's the same!?
Message-ID: <54807B93.9040909@hemmings.eclipse.co.uk>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

Update

On 04/12/14 14:53, Peter Hemmings wrote:
>
> On 04/12/14 14:20, Nigel Sollars wrote:
>> Since this is cron, does crontab -e not work?
>>
>> On Thu, Dec 4, 2014 at 9:09 AM, David Smith <David.Smith@imgtec.com
>> <mailto:David.Smith@imgtec.com>> wrote:
>>
>> From: bristol-bounces@mailman.lug.org.uk
>> <mailto:bristol-bounces@mailman.lug.org.uk> [mailto:bristol-
>> <mailto:bristol->
>> bounces@mailman.lug.org.uk <mailto:bounces@mailman.lug.org.uk>]
>> On Behalf Of Peter Hemmings
>> > On the Pi Nano reports no such file/directory and I cannot see if there is any
>> > config I can do to make it the same as on my Fedora, which is
>> what is
>> > assumed on my DHT11 info link on the other thread.
>>
>> Some other thoughts:
>>
>> Can you edit pre-existing files with nano?
>>
> Seems I can
> If you can, then how about using "touch" to create the empty file and
> then editing it?
>
> Yep I can do that also - but never had to before!
>
> Just tried again and it seems to be working, so it must have been me
> again. I will try again later.
>
> I may have been getting a bit muddled with how I should be using cron
> and had used a combination of crontab shown in the earlier DHT11
> logging part, or using the cron.d folder which I read supersedes it.
>
> I read about this from:
>
> http://www.devils-heaven.com/raspberry-pi-cron-jobs/
>
>
> Is that the preferred way to do it now?
>
>
>> _______________________________________________
>> Bristol mailing list
>> Bristol@mailman.lug.org.uk <mailto:Bristol@mailman.lug.org.uk>
>> https://mailman.lug.org.uk/mailman/listinfo/bristol
>>
>>
>>
>>
>> --
>> "Science is a differential equation. Religion is a boundary condition."
>> Alan Turing
>>
>>
>> _______________________________________________
>> Bristol mailing list
>> Bristol@mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/bristol
> Will get back to it later this evening
>
>
> Regards
> --
> Peter H
>
>
> _______________________________________________
> Bristol mailing list
> Bristol@mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/bristol

output trying to use later method:

pi@raspberry ~/wiringPi $ sudo ./dht11
44.0,24.0
pi@raspberry ~/wiringPi $ nano /home/pi/scripts/cron.sh
bash: nano /home/pi/scripts/cron.sh: No such file or directory
pi@raspberry ~/wiringPi $ cd ..
pi@raspberry ~ $ ls
artwork.jpg dht11.c indiecity ocr_pi.png python_games script
wiringPi
Desktop Documents mycron output.pdf Scratch scripts
pi@raspberry ~ $ cd scripts
pi@raspberry ~/scripts $ nano /home/pi/scripts/cron.sh
bash: nano /home/pi/scripts/cron.sh: No such file or directory
pi@raspberry ~/scripts $

Just tried strace and it worked!!!

Go to go out now and have a beer!

--
Peter H

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.lug.org.uk/mailman/private/bristol/attachments/20141204/b7858199/attachment-0001.html>

------------------------------

Message: 2
Date: Thu, 04 Dec 2014 16:13:40 +0000
From: Shane McEwan <shane@mcewan.id.au>
To: bristol@mailman.lug.org.uk
Subject: Re: [bristol] Are all Nano's the same!?
Message-ID: <54808834.9060000@mcewan.id.au>
Content-Type: text/plain; charset=utf-8

On 04/12/14 15:19, Peter Hemmings wrote:
> Update
>> I may have been getting a bit muddled with how I should be using cron
>> and had used a combination of crontab shown in the earlier DHT11
>> logging part, or using the cron.d folder which I read supersedes it.
>>
>> I read about this from:
>>
>> http://www.devils-heaven.com/raspberry-pi-cron-jobs/
>>
>>
>> Is that the preferred way to do it now?

Using the crontab command is the safest way because if you mess up the
entry (miss out date fields or put in invalid values) it will refuse to
save the file. It's most useful for normal users to add cron jobs to run
under their account because they won't have access to the /etc/cron*
directories.

On a large system the root user's crontab file would end up huge and
convoluted so eventually the separate cron directories were created
(/etc/cron.daily, etc) in order to simplify things. Now each cron job is
in a separate file in each directory. It's much neater but I find it
more of a hassle if I'm trying to find a particular job.

Behind the scenes the cron directories are still run from normal cron
jobs in root's crontab file. Have a look in /etc/crontab and you'll see
the jobs.

If you don't need to run the command as root then just put it in your
normal user's crontab file using the crontab command. If you need the
command to run as root then put it into one of the /etc/cron*
directories as a separate script.

> output trying to use later method:
>
> pi@raspberry ~/wiringPi $ sudo ./dht11
> 44.0,24.0
> pi@raspberry ~/wiringPi $ nano /home/pi/scripts/cron.sh
> bash: nano /home/pi/scripts/cron.sh: No such file or directory
> pi@raspberry ~/wiringPi $ cd ..
> pi@raspberry ~ $ ls
> artwork.jpg dht11.c indiecity ocr_pi.png python_games script
> wiringPi
> Desktop Documents mycron output.pdf Scratch scripts
> pi@raspberry ~ $ cd scripts
> pi@raspberry ~/scripts $ nano /home/pi/scripts/cron.sh
> bash: nano /home/pi/scripts/cron.sh: No such file or directory
> pi@raspberry ~/scripts $

It looks to me like bash is treating the whole command as a single string.

If I type the command with quotes around it:

$ "nano /tmp/test.txt"

I get:

bash: nano /tmp/test.txt: No such file or directory

This matches your error messages. The error is coming from bash, not
nano, and it is saying that the file called "nano
/home/pi/scripts/cron.sh" doesn't exist. I don't know how you've managed
to get this to happen, though. Is 'nano' aliased to something? Type
'alias' in the shell and see.

Enjoy your beer!

Shane.





------------------------------

Message: 3
Date: Thu, 04 Dec 2014 18:12:42 +0000
From: "Alex Butcher (LUG)" <lug@assursys.co.uk>
To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
Subject: Re: [bristol] Are all Nano's the same!?
Message-ID: <02328F0F-363F-40D1-AE75-7D66AAAAFC1E@assursys.co.uk>
Content-Type: text/plain; charset=UTF-8



On 4 December 2014 16:13:40 GMT+00:00, Shane McEwan <shane@mcewan.id.au> wrote:

>It looks to me like bash is treating the whole command as a single
>string.

I concur.

>
>If I type the command with quotes around it:
>
>$ "nano /tmp/test.txt"
>
>I get:
>
>bash: nano /tmp/test.txt: No such file or directory
>
>This matches your error messages. The error is coming from bash, not
>nano, and it is saying that the file called "nano
>/home/pi/scripts/cron.sh" doesn't exist. I don't know how you've
>managed
>to get this to happen, though. Is 'nano' aliased to something? Type
>'alias' in the shell and see.

My guess is that Peter is copy and pasting from a webpage that isn't using spaces, but Unicode characters that /look identical to spaces/, to separate words.

Welcome to the 21st century where nothing works simply any more!

>
>Enjoy your beer!
>
>Shane.
>
>
>
>_______________________________________________
>Bristol mailing list
>Bristol@mailman.lug.org.uk
>https://mailman.lug.org.uk/mailman/listinfo/bristol

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.



------------------------------

Message: 4
Date: Thu, 04 Dec 2014 18:32:43 +0000
From: Peter Hemmings <peter@hemmings.eclipse.co.uk>
To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
Subject: Re: [bristol] Are all Nano's the same!?
Message-ID: <5480A8CB.3090807@hemmings.eclipse.co.uk>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


On 04/12/14 16:13, Shane McEwan wrote:
> On 04/12/14 15:19, Peter Hemmings wrote:
>> Update
>>> I may have been getting a bit muddled with how I should be using cron
>>> and had used a combination of crontab shown in the earlier DHT11
>>> logging part, or using the cron.d folder which I read supersedes it.
>>>
>>> I read about this from:
>>>
>>> http://www.devils-heaven.com/raspberry-pi-cron-jobs/
>>>
>>>
>>> Is that the preferred way to do it now?
> Using the crontab command is the safest way because if you mess up the
> entry (miss out date fields or put in invalid values) it will refuse to
> save the file. It's most useful for normal users to add cron jobs to run
> under their account because they won't have access to the /etc/cron*
> directories.
>
> On a large system the root user's crontab file would end up huge and
> convoluted so eventually the separate cron directories were created
> (/etc/cron.daily, etc) in order to simplify things. Now each cron job is
> in a separate file in each directory. It's much neater but I find it
> more of a hassle if I'm trying to find a particular job.
>
> Behind the scenes the cron directories are still run from normal cron
> jobs in root's crontab file. Have a look in /etc/crontab and you'll see
> the jobs.
>
> If you don't need to run the command as root then just put it in your
> normal user's crontab file using the crontab command. If you need the
> command to run as root then put it into one of the /etc/cron*
> directories as a separate script.
>
OK TA


>> output trying to use later method:
>>
>> pi@raspberry ~/wiringPi $ sudo ./dht11
>> 44.0,24.0
>> pi@raspberry ~/wiringPi $ nano /home/pi/scripts/cron.sh
>> bash: nano /home/pi/scripts/cron.sh: No such file or directory
>> pi@raspberry ~/wiringPi $ cd ..
>> pi@raspberry ~ $ ls
>> artwork.jpg dht11.c indiecity ocr_pi.png python_games script
>> wiringPi
>> Desktop Documents mycron output.pdf Scratch scripts
>> pi@raspberry ~ $ cd scripts
>> pi@raspberry ~/scripts $ nano /home/pi/scripts/cron.sh
>> bash: nano /home/pi/scripts/cron.sh: No such file or directory
>> pi@raspberry ~/scripts $
> It looks to me like bash is treating the whole command as a single string.
>
> If I type the command with quotes around it:
>
> $ "nano /tmp/test.txt"
>
> I get:
>
> bash: nano /tmp/test.txt: No such file or directory
>
> This matches your error messages. The error is coming from bash, not
> nano, and it is saying that the file called "nano
> /home/pi/scripts/cron.sh" doesn't exist. I don't know how you've managed
> to get this to happen, though. Is 'nano' aliased to something? Type
> 'alias' in the shell and see.

pi@raspberry ~ $ alias
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias ls='ls --color=auto'
pi@raspberry ~ $


> Enjoy your beer!

Just going

> Shane.
>
>
>
> _______________________________________________
> Bristol mailing list
> Bristol@mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/bristol

--
Peter H




------------------------------

Message: 5
Date: Thu, 04 Dec 2014 18:38:15 +0000
From: Peter Hemmings <peter@hemmings.eclipse.co.uk>
To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
Subject: Re: [bristol] Are all Nano's the same!?
Message-ID: <5480AA17.1090507@hemmings.eclipse.co.uk>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


On 04/12/14 18:12, Alex Butcher (LUG) wrote:
>
> On 4 December 2014 16:13:40 GMT+00:00, Shane McEwan <shane@mcewan.id.au> wrote:
>
>> It looks to me like bash is treating the whole command as a single
>> string.
> I concur.
>
>> If I type the command with quotes around it:
>>
>> $ "nano /tmp/test.txt"
>>
>> I get:
>>
>> bash: nano /tmp/test.txt: No such file or directory
>>
>> This matches your error messages. The error is coming from bash, not
>> nano, and it is saying that the file called "nano
>> /home/pi/scripts/cron.sh" doesn't exist. I don't know how you've
>> managed
>> to get this to happen, though. Is 'nano' aliased to something? Type
>> 'alias' in the shell and see.
> My guess is that Peter is copy and pasting from a webpage that isn't using spaces, but Unicode characters that /look identical to spaces/, to separate words.
>
> Welcome to the 21st century where nothing works simply any more!

Maybe I pasted the first time I was doing it and not the last time!!

I will go back to the original crontab instructions and type it all in
carefully!

>> Enjoy your beer!
>>
>> Shane.
>>
>>
>>
>> _______________________________________________
>> Bristol mailing list
>> Bristol@mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/bristol
Regards (from my Pi)

--
Peter H




------------------------------

_______________________________________________
Bristol mailing list
Bristol@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/bristol

End of Bristol Digest, Vol 579, Issue 8
***************************************

Tidak ada komentar:

Posting Komentar