Go to advanced search

by timmoore46
Wed Feb 27, 2013 10:11 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

created a 'master' directory in directory 'pi' moved the files over and sudo chmod a+x the script and lots of permission denied ! scattered a 'sudo' behind each line with an error message, but to no avail. Its reading and writing to the GPIO so it might be a tad sensitive about that ! lets leave thi...
by timmoore46
Wed Feb 27, 2013 9:24 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

logFile="control_004.log"
echo "$(date)" | tee -a $logFile


root@raspberrypi:~# cat control_004.log


Wed Feb 27 09:04:22 UTC 2013

Wed Feb 27 09:04:28 UTC 2013


___________________________

the rest of it is missing.

viz:-
start quote

y is :-
1
z is :-
0
end quote

????

:D :D

Tim
by timmoore46
Wed Feb 27, 2013 8:56 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

Many thanks, I'll try that. a small mystery nano control_004.log yields Mon Feb 25 18:08:38 UTC 2013 Mon Feb 25 18:08:44 UTC 2013 Mon Feb 25 18:08:51 UTC 2013 Mon Feb 25 18:08:57 UTC 2013 Mon Feb 25 18:09:03 UTC 2013 Mon Feb 25 18:09:09 UTC 2013 Mon Feb 25 18:13:15 UTC 2013 Mon Feb 25 18:13:21 UTC 2...
by timmoore46
Wed Feb 27, 2013 8:40 am
Forum: General discussion
Topic: Getting Nano into monochrome !
Replies: 9
Views: 2355

Re: Getting Nano into monochrome !

Mega Brill ! will do that !

Your help is greatly appreciated.

:D :D :D :D :D

Tim
by timmoore46
Wed Feb 27, 2013 8:31 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

code:- logfile="control_004.log" => logFile ="control_004.log" echo "$(date)" | tee -a $logFile yields ./test_002: 13: ./test_002: cannot create logFile =control_004.log: Directory nonexistent would be be easier to follow if the name was changed of 'logFile' to 'example_001' ? have I made an idiot t...
by timmoore46
Wed Feb 27, 2013 6:57 am
Forum: General discussion
Topic: Getting Nano into monochrome !
Replies: 9
Views: 2355

Re: Getting Nano into monochrome-fixed!

That worked a treat !

Now the next question is line numbers. Can they be displayed cos BASH error messages for scripts give a line number (and not all my scripts work first time! *LOL*)

:D :D :D :D

Tim
by timmoore46
Wed Feb 27, 2013 6:51 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

code was:- logfile="control_004.log" echo "$(date)" | tee -a $logFile and the hope was all the screen output would wind up being added to a file. the output that actually is out put to the screen is:- quote root@raspberrypi:~# ./test_002 Wed Feb 27 06:43:28 UTC 2013 y is :- 1 z is :- 0 Wed Feb 27 06...
by timmoore46
Tue Feb 26, 2013 9:12 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

$logFile

The upper case F

does that have significance ?

what would happen if it was :-

$logfile

I'm just paranoid about anything as unforgiving as assembler or BASH.

:D :D :D

Tim

logfile="control_004.log"
by timmoore46
Tue Feb 26, 2013 8:55 am
Forum: General discussion
Topic: Question about using the RPi with a relay.
Replies: 73
Views: 74599

Re: Question about using the RPi with a relay.

A reverse biased Diode type 1N4001 across the relay coil is vital !

the white ring on the diode must be +ve e.g. connected to the +5v supply.

Otherwise anything connected to the relay will be killed by the voltage spike.

Hope that supplies the fix.

:D

Tim
by timmoore46
Mon Feb 25, 2013 10:12 pm
Forum: General discussion
Topic: where can i find packag(es) with common linux command
Replies: 5
Views: 871

Re: where can i find packag(es) with common linux command

Try getting a printer to run on SUSE 1995 ! Nightmare task ! *LOL*, 12 years later it still was !
by timmoore46
Mon Feb 25, 2013 8:01 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

Many thanks again, especially for your patience !

I will try it out tomorrow.

:D :D :D :D :D :D

Tim
by timmoore46
Mon Feb 25, 2013 7:04 pm
Forum: General discussion
Topic: Getting Nano into monochrome !
Replies: 9
Views: 2355

Re: Getting Nano into monochrome !

Hi Stu,

Thats Mega Brill ! Trying it out in next minute !

:D :D :D :D :D :D :D :D :D :D

Tim
by timmoore46
Mon Feb 25, 2013 6:26 pm
Forum: General discussion
Topic: Getting Nano into monochrome !
Replies: 9
Views: 2355

Getting Nano into monochrome !

I'm colour blind and when nano offers all sorts of bright pastel colours, I can't read/see the text!

I've fiddled with the 'preferences' but have not got it sorted out.

Does anyone know how to get it into black text only ?

:D :D :D

Tim
by timmoore46
Mon Feb 25, 2013 6:19 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

logfile="control_004.log"
echo "$(date)" >>control_004.log

date


saves the date stamp fine.

The next challenge is to get anything sent to the console into the logfile too...

:D :D :D :D :D

Tim
by timmoore46
Mon Feb 25, 2013 6:05 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

Wow ! removed the $ from the 2nd line and it worked !

Many many thanks! Especially for your patience.

As you can tell my understanding of BASH is close to non existent !

I'll play with this and see if I can get work in my mail control program !

:D :D :D :D :D :D

Tim
by timmoore46
Mon Feb 25, 2013 7:37 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

I tried this:-

logfile="test.log"

echo "$date" >> $test.log

and it does not work.

Obviously I'm missed something vital !

:( :( :( :(

Tim
by timmoore46
Sun Feb 24, 2013 9:19 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

Wow ! Mega Brilliant ! At this stage the simplest solution is the best ! Occam was right ! *LOL*

That was exactly what I needed ! Apart from a Tardis ! Time always is tricky ! *LOL*

:D :D :D :D :D :D

Tim
by timmoore46
Sun Feb 24, 2013 6:26 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

Well, my logic is a bit off, but what concerns me now is how to pass the information to a 'log' file, so I can go back and look at it.

I've added 'date' to it so I've got a real time record of events,,,,,,

any ideas anyone ?


:D :D :D

Tim
by timmoore46
Sun Feb 24, 2013 7:31 am
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Re: Bash script works but strange message

Many many thanks ! I really appreciate all your support !

I will amend my script and see if it behaves better !

A very happy,

:D

Tim
by timmoore46
Sat Feb 23, 2013 6:22 pm
Forum: General discussion
Topic: Bash script works but strange message
Replies: 58
Views: 8437

Bash script works but strange message

I'm trying to use a sort of 'and' function but I'm a rank newbie to BASH This is the truth table I'm attempting to simulare in the scipt:- Inputs outputs an altered y called d y z d 0 0 0 0 1 1 1 0 1 1 1 1 and it works..... #! /bin/sh # 23/2/13 # chmod a+x logic_003 # control c stops the program # u...
by timmoore46
Mon Feb 18, 2013 12:56 pm
Forum: General discussion
Topic: Using the dd command in scripts
Replies: 10
Views: 1862

Re: Using the dd command in scripts

I use dd and I love shell scripting, but dd is just too bl**dy dangerous to use in a shell script IMO. I avoid using it unless I'm 'sharp'. (Old dinosaur - the brain doesn't work 100% sometimes). Putting a dumb shell script in charge is asking for it. I totally agree with that ! :D :D :D :D :D Tim
by timmoore46
Sun Feb 17, 2013 5:22 am
Forum: General discussion
Topic: Using the dd command in scripts
Replies: 10
Views: 1862

Re: Using the dd command in scripts

I'm terrified of dd but I need to use it for shrinking a partition. So if any one finds an idiots guide with loads of working examples, I'm very interested too !

:? :? :?

Tim
by timmoore46
Sat Feb 16, 2013 8:45 am
Forum: Beginners
Topic: GPIO using Bash - help
Replies: 16
Views: 52400

Re: GPIO using Bash - help

What I tried to do when I thought I have nuked my RPi was to send a slow square wave (changed voltage every 3 seconds) to the Header GPIO Output pin 7. This works:- root@raspberrypi:~# cat control_output_test_002 #! /bin/sh # chmod a+x control_output_002 # Outputs to Header Pin 7 # control c stops t...
by timmoore46
Fri Feb 15, 2013 9:12 am
Forum: Beginners
Topic: GPIO using Bash - help
Replies: 16
Views: 52400

Re: GPIO using Bash - help

That explains all ! Many thanks !

:D :D :D :D

Tim
by timmoore46
Thu Feb 14, 2013 2:14 pm
Forum: Beginners
Topic: GPIO using Bash - help
Replies: 16
Views: 52400

Re: GPIO using Bash - help

This gave a unwanted message: Cat: z: No Such file or directory. Quote prog oot@raspberrypi:~# cat control_999 #! /bin/sh # control_999 # chmod a+x control_999 # control c stops the program while true do #setup Input echo "7" > /sys/class/gpio/export echo "in" > /sys/class/gpio/gpio7/direction cat /...

Go to advanced search