ashwini
Posts: 45
Joined: Sun Feb 08, 2015 11:35 am

error in running a command

Sun Feb 08, 2015 12:14 pm

I am trying to run the downloaded script with following commands :
1.chmod +x install-piface-real-time-clock.sh
2.sudo ./install-piface-real-time-clock.sh
I am getting error as "command not found" for second command. Then what should i do?

bulletmark
Posts: 121
Joined: Wed Oct 17, 2012 10:10 pm
Location: Brisbane Australia

Re: error in running a command

Sun Feb 08, 2015 10:24 pm

Look at the very first line in that script. If it's a shebang line (i.e. starts with #!) then likely that program does not exist.

ashwini
Posts: 45
Joined: Sun Feb 08, 2015 11:35 am

Re: error in running a command

Mon Feb 09, 2015 9:21 am

It is not any program. I am trying to download script for RTC using these two commands that i have mention earlier.

User avatar
DougieLawson
Posts: 38504
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: error in running a command

Mon Feb 09, 2015 9:29 am

ashwini wrote:It is not any program. I am trying to download script for RTC using these two commands that i have mention earlier.
Is it safe to assume you're trying to run this bash program?
https://github.com/piface/PiFace-Real-T ... e-clock.sh
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

ashwini
Posts: 45
Joined: Sun Feb 08, 2015 11:35 am

Re: error in running a command

Mon Feb 09, 2015 10:11 am

Yes sir, I am trying to run the same program.

User avatar
DougieLawson
Posts: 38504
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: error in running a command

Mon Feb 09, 2015 10:32 am

Run it like this:

sudo bash -x ./install-piface-real-time-clock.sh

and it will spew out lots of extra output that should help you identify what's missing.

Running it on my system gets

Code: Select all

[email protected]:/tmp/PiFace-Real-Time-Clock$ sudo bash -x ./install-piface-real-time-clock.sh
+ [[ 0 -ne 0 ]]
+ RPI_REVISION=
+ set_revision_var
++ grep Revision /proc/cpuinfo
+ rev_str='Revision     : 000f'
+ len_rev_str=15
+ chr_index=14
+ chr=f
+ [[ f == \2 ]]
+ [[ f == \3 ]]
+ RPI_REVISION=2
+ enable_module
+ echo 'Enabling I2C module.'
Enabling I2C module.
+ module=i2c-bcm2708
+ modules_file=/etc/modules
+ grep -q i2c-bcm2708 /etc/modules
+ start_on_boot
+ echo 'Changing /etc/rc.local to load time from PiFace Clock.'
Changing /etc/rc.local to load time from PiFace Clock.
+ sed -i 's/exit 0//' /etc/rc.local
+ [[ 2 == \1 ]]
+ i=1
+ cat
+ printf 'Please *reboot* and then set your clock with:

    sudo date -s "14 JAN 2014 10:10:30"

'
Please *reboot* and then set your clock with:

    sudo date -s "14 JAN 2014 10:10:30"

[email protected]:/tmp/PiFace-Real-Time-Clock$
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

ashwini
Posts: 45
Joined: Sun Feb 08, 2015 11:35 am

Re: error in running a command

Mon Feb 09, 2015 11:16 am

Thank you sir.
I did it the same way as you told. But I didn't get that much data as that of yours. I just got a single message ending with :
".........it is a directory."
Once again thank you, sir.

User avatar
rpdom
Posts: 16741
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: error in running a command

Mon Feb 09, 2015 9:11 pm

ashwini wrote:I just got a single message ending with :
".........it is a directory."
Please show the whole, exact, message. It is not easy to guess what is wrong without it.
The best thing to do is to copy and paste the output, including the command, just as Dougie did.

Return to “Beginners”