Register
It is currently Mon Sep 01, 2014 3:05 pm

Amarok theme script.


All times are UTC - 6 hours


Post new topic Reply to topic  [ 6 posts ] 
Author Message
 PostPosted: Thu Oct 19, 2006 10:31 am   

Joined: Fri Oct 14, 2005 9:30 am
Posts: 61
Okay I have started to write a script that will change the theme of amarok using superkaramba and various themes available, and have already hit upon a problem:
Code:
#!/bin/bash
###################################
#Variables
app="`echo which`"
msg1="$app: no superkaramba in ($PATH)"
##########Start Functions##########
function does_superkaramba ()
{
if [[ `which superkaramba`==$msg1 ]]
then
   echo "superkaramba not installed, please install it then re-run this script"
fi
}
does_superkaramba

I have superkaramba, so AFAIK that should exit without printing anything, yet it always prints out the failure message. The variable $msg1 when echoed looks the same as the error message when which comes upon an unistalled program.

Why is it doing this?
Thanks,
Rob


Top
 Profile WWW  
 PostPosted: Thu Oct 19, 2006 10:46 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
try this inside the function instead... just for kicks

Code:
if [[ ! `which superkaramba` ]]
then
   echo "superkaramba not installed, please install it then re-run this script"
fi


Top
 Profile  
 PostPosted: Thu Oct 19, 2006 11:06 am   

Joined: Fri Oct 14, 2005 9:30 am
Posts: 61
Oh it works now, thanks :D.
What does the ! do?
Cheers,
Rob


Top
 Profile WWW  
 PostPosted: Thu Oct 19, 2006 1:58 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
well... we were checking to see if `which superkaramba` executed without error... the ! means NOT
so... if NOT `which superkarambe` (works without error); send error message


Top
 Profile  
 PostPosted: Thu Oct 19, 2006 2:50 pm   

Joined: Fri Oct 14, 2005 9:30 am
Posts: 61
aaah makes sense.
Thanks jb :D


Top
 Profile WWW  
 PostPosted: Thu Oct 19, 2006 4:09 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
anytime :D


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP