LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-08-2007, 11:03 PM   #1
wanghao
Member
 
Registered: Mar 2007
Distribution: centos
Posts: 126

Rep: Reputation: 15
the variable not works


Code:
#!/bin/bash
#This is used for waching the vod 
#tv
#author wanghao
echo "now you are in the tv "
if [ "$2" = "s" ];then
  s= "-cache 8192"
  else 
  s=""
fi 
#sleep 5 
case $1 in 
   "7")
   mplayer mms://address $s 
   ;;
   "8") 
   mplayer mms://address $s 
   ;;
   "9") 
   mplayer mms://address $s 
   ;;
   "10")
   mplayer mms://address $s
   ;;
   "fhws") 
   mplayer mms://address $s
   ;;
   "12") 
   mplayer mms://address $s
   ;;
   "fhinfo")   
   mplayer mms://address $s

   ;;
   "*")
   echo "nothing"
   ;;
esac
but when i add run "tv 1 -s ",it always prompt "command -cache -8192 not find",where the problem is ?

Last edited by reddazz; 12-08-2007 at 11:13 PM. Reason: added code tags
 
Old 12-09-2007, 03:33 AM   #2
Vookimedlo
Member
 
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
Hi,

You can't have white characters in assignment.


Code:
s="-cache 8192"
 
Old 12-09-2007, 04:18 AM   #3
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
Have you tried launching your script with "tv 1 s" ?
ciao
 
Old 12-10-2007, 08:07 PM   #4
wanghao
Member
 
Registered: Mar 2007
Distribution: centos
Posts: 126

Original Poster
Rep: Reputation: 15
yes,thanks friends,that's the white chatacter problem.
Thanks again!it works well now!
 
  


Reply



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
PHP variable code works on Windows Server but not Linux Server Russianspi Programming 2 07-05-2007 01:23 PM
Replace variable with user defined variable ce124 Programming 10 04-13-2007 09:29 AM
setting a variable variable in a script... this works, but could it be more elegant? pwc101 Programming 3 08-18-2006 11:23 AM
Scripting: accessing a variable stored in a variable? tomolesonjr Linux - Newbie 5 05-05-2006 08:47 PM
XAWTV works, videodog works, motion works but how to code my own? rylan76 Linux - Hardware 0 01-06-2006 06:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:02 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration