LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices

Reply
 
Search this Thread
Old 05-05-2014, 05:26 PM   #1
Fixit7
Member
 
Registered: Mar 2014
Posts: 162

Rep: Reputation: 0
Script only works from konsole


For some reason, this only works from a konsole using FatDog.

It does not work when run from a File Manager.

Same script works fine with Puppy 5.6. using Thunar, etc.

Code:
# Linux Puppy 6.5.0 and FatDog
#  Cpu_Temp.sh  Show CPU temperatures (duo core in my case)
# "echo" creates a newline in a text file
#
# 1st check if sensors is installed
cd /
cd root/my-applications/lm_sensors-3.3.5/prog/sensors
date "+DATE: %m/%d/%y%nTIME: %r" >> cpu_temp.txt
echo >> cpu_temp.txt
sensors -f >> cpu_temp.txt
geany cpu_temp.txt
_________________
Andy

Slacko Puppy 5.6.0
Windows XP SP3
 
Old 05-05-2014, 07:39 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,474

Rep: Reputation: 155Reputation: 155
This may be a problem with different PATHs being available in the various places you start the script. Try giving the full file name when you invoke the sensors and geany commands.

---------------------
Steve Stites
 
Old 05-06-2014, 03:55 PM   #3
Fixit7
Member
 
Registered: Mar 2014
Posts: 162

Original Poster
Rep: Reputation: 0
I think the problem is with Xfe file manager.

None of the scripts work when double clicked.

Andy

I prefer Thunar but can not get it installed.
 
Old 05-06-2014, 04:07 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,990
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
...also I would rewrite the script as a proper shell script:
Code:
#!/bin/bash --
# Uncomment for debug output when testing:
# set -vxe
# Set default behaviour:
LANG=C; LC_ALL=C; export LANG LC_ALL

# Check if lm_sensors is installed:
which sensors >/dev/null 2>&1 || { echo "lm_sensors not installed, exiting."; exit 127; }

# Check if logger is installed (see 'man logger'):
which logger >/dev/null 2>&1 || { echo "logger not installed, exiting."; exit 127; }

# Sensors should be properly installed, not in /root/my-applications/lm_sensors-3.3.5/prog/sensors!
# Loop over the lines of output and have logger inset it into syslog. This way you keep your data central,
# (for which you actually should use the SysV init script and service lm_sensor sprovides IMHO) and you get
# time stamps for free.
sensors -f | while read LINE; do logger -t sensors "${LINE}"; done

exit 0
Now you can save this script as say "/etc/cron.hourly/sensors.cron" and if you want to check the values open a terminal window and run say
Code:
tail -f /var/log/messages|grep sensors
 
Old 05-06-2014, 05:18 PM   #5
Fixit7
Member
 
Registered: Mar 2014
Posts: 162

Original Poster
Rep: Reputation: 0
I saved your script as .sh but it does the same as my script.

I think it is a File Manager issue.

Andy
 
Old 05-06-2014, 06:10 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,990
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Quote:
Originally Posted by Fixit7 View Post
I saved your script as .sh but it does the same as my script.
Note my script won't give you output the way your script does nor does it open geany for you. Also note you seem to have installed sensors in /root/my-applications/lm_sensors-3.3.5/prog/ instead of /usr/bin or /usr/local/bin. That is not how you should install applications and "/root/my-applications/lm_sensors-3.3.5/prog/" most definitely will not be in your
Code:
echo $PATH
 
Old 05-06-2014, 06:14 PM   #7
Fixit7
Member
 
Registered: Mar 2014
Posts: 162

Original Poster
Rep: Reputation: 0
Thanks.

I could not install sensors using the package manager.

It could not find sensors, so I did my own manual install.

I just installed midnight commander and my scripts work fine.

I prefer Thunar, but can live with mc.

FatDog does not create menu entries for any newly installed programs which is a big no-no in my book. :-)

Andy

I mainly use Puppy Slacko 5.6 for most of my work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
executing konsole from shell script Meriadoc Linux - Newbie 10 07-10-2009 08:08 AM
make desktop link to konsole script? babag Mandriva 3 10-08-2008 01:55 PM
No access to internet from Konsole, Konqueror works fine Tim.R Linux - Networking 2 06-07-2006 09:57 PM
biff works over ssh but not locally (in Konsole) jashmenn Slackware 0 03-17-2006 07:23 PM
How can I create a keyboard script for konsole? geekzster Linux - Newbie 3 04-18-2004 03:56 AM


All times are GMT -5. The time now is 03:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration