LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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-13-2014, 09:11 PM   #16
rokytnji
Senior Member
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: AntiX 13 , MacPup,Slack0,MX-14, SaliX
Posts: 2,622
Blog Entries: 18

Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847

My bad then evo2.

Code:
sudo shutdown
Code:
sudo reboot
works in AntiX. Without a password even.

as root

Code:
shutdown -h now
has never failed me in anything but maybe puppy. Yep, Just checked in Slack0 5.7 puppy and no shutdown command found.

Code:
shutdown -r now
is pretty standard across distros for reboot except Puppy.

inxi for me has never hurt to install and run was why I thought it would be OK for what the OP wanted.
 
Old 05-14-2014, 01:56 AM   #17
Fixit7
Member
 
Registered: Mar 2014
Posts: 167

Original Poster
Rep: Reputation: 0
How do I test test what commands are available ?

Andy
 
Old 05-14-2014, 02:27 AM   #18
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,319

Rep: Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142
Hi,
Quote:
Originally Posted by Fixit7 View Post
How do I test test what commands are available ?
you can start by using "which". For example if you wanted to see if wmpoweroff exists you could do;
Code:
which wmpoweroff > /dev/null 2>&1
if [ "$?" = "0" ] ; then
  echo "This system has wmpoweroff"
else
  echo "This system does not have wmpoweroff"
fi
The key points here are that the "which" command will exit with status "0" if it finds the command and status "1" if not and that the value of the exit status of last command run is always stored in the variable called "$?".

HTH,

Evo2.
 
  


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
Which LXDE version of Linux has the newest version of Firefox and Open Office? coolguy2008 Linux - Newbie 6 09-19-2010 12:04 PM


All times are GMT -5. The time now is 09:22 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