LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2007, 03:21 AM   #16
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Original Poster
Rep: Reputation: 34

I got:
Code:
bash: ./script: Permission denied
I logged on as root and did the same. I still got the same error. Permission denied? On root?

When I ran it using the previous command you supplied, I forgot to tell you that, after getting that job number, when I pressed Enter I got:

Quote:
[1]+ Exit 126 ./sd >/dev/null 2>&1

Last edited by gregorian; 03-02-2007 at 03:24 AM.
 
Old 03-02-2007, 03:42 AM   #17
nmh+linuxquestions.o
Member
 
Registered: Feb 2007
Posts: 135

Rep: Reputation: 15
Quote:
Originally Posted by gregorian
I got:
Code:
bash: ./script: Permission denied
I logged on as root and did the same. I still got the same error. Permission denied? On root?

When I ran it using the previous command you supplied, I forgot to tell you that, after getting that job number, when I pressed Enter I got:
Did you
Code:
chmod u+x script
 
Old 03-02-2007, 03:56 AM   #18
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Original Poster
Rep: Reputation: 34
No, I didn't need to, as these were its permissions:
rwxr-xr-x

I just found an interesting thing-- Open any link on your desktop using a text editor. You will see an option called TERMINAL=false.
That explains why I don't see any terminal and can see only the video while running the script. If you can figure out how KDE executes TERMINAL=false, the problem will be solved. I don't know how KDE executes such commands.

Last edited by gregorian; 03-02-2007 at 06:17 AM.
 
Old 03-02-2007, 04:47 AM   #19
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I tried it again on my desktop and it worked.

nohup mplayer -really-quiet <video> &

This also worked in the virtual terminal vt/1:
nohup mplayer -vo fbdev2 -really-quiet <video> &

Last edited by jschiwal; 03-02-2007 at 04:51 AM.
 
Old 03-02-2007, 06:17 AM   #20
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Original Poster
Rep: Reputation: 34
I tried both your commands jschiwal, but neither of them work. Stupid RH9

But still, do you know how to do the TERMINAL=false thing I mentioned in my previous post.
 
Old 03-02-2007, 08:00 AM   #21
nmh+linuxquestions.o
Member
 
Registered: Feb 2007
Posts: 135

Rep: Reputation: 15
kde dcop urls

Quote:
Originally Posted by gregorian
No, I didn't need to, as these were its permissions:
rwxr-xr-x

I just found an interesting thing-- Open any link on your desktop using a text editor. You will see an option called TERMINAL=NO.
That explains why I don't see any terminal and can see only the video while running the script. If you can figure out how KDE executes TERMINAL=NO, the problem will be solved. I don't know how KDE executes such commands.
I will assert that it is better to use a portable solution, but if you want to figure out all sorts of KDE internals, you might do well to start looking at the KDE docs:

http://developer.kde.org/documentati...lo/khello1.htm
http://developer.kde.org/documentati...ion/index.html
http://developer.kde.org/documentati...interface.html
http://developer.kde.org/documentati...als/index.html
http://www-128.ibm.com/developerwork...kdeml01KDEDCOP
 
Old 03-03-2007, 02:24 AM   #22
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You would use the terminal=false entry if you are linking to a gui program and terminal=true if you are linking to a script program, i.e. with menu. You might try looking at the .desktop entry for a program like firefox. Sometimes you are running a wrapper script. If you want to run mplayer in kde, you could simply call gmplayer instead.

Also, which terminal emulator are you running. I ran my test using konsole on two different computers. And on vt/1 using the framebuffer device. Also if you want to start playing something in particular by double clicking on an icon, you can make a copy of an xmms icon and add an argument list after the command in the properties.

Using dcop as the poster above mentioned is the most powerful and flexible approach.

Last edited by jschiwal; 03-03-2007 at 02:25 AM.
 
Old 03-03-2007, 08:01 AM   #23
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Original Poster
Rep: Reputation: 34
You're right kdcop is indeed an awesome program. I learned many things by reading that link, but I cant seem to figure out how TERMINAL=OFF is acheived by it. Also, isn't there a simpler way to invoke the script without having to view the terminal. I'm fine with using the screen command, but I want to know if there is any other way.

I use konsole too.
 
Old 03-03-2007, 06:27 PM   #24
nmh+linuxquestions.o
Member
 
Registered: Feb 2007
Posts: 135

Rep: Reputation: 15
Quote:
Originally Posted by jschiwal
Using dcop as the poster above mentioned is the most powerful and flexible approach.
While dcop is powerful and flexible, it is not portable.

Quote:
Originally Posted by gregorian
You're right kdcop is indeed an awesome program. I learned many things by reading that link, but I cant seem to figure out how TERMINAL=OFF is acheived by it. Also, isn't there a simpler way to invoke the script without having to view the terminal. I'm fine with using the screen command, but I want to know if there is any other way.

I use konsole too.
The "TERMINAL=OFF" thing is a small flag in a special file. If you want to do something like that, you need to poke around in dcop/kde internals/docs to find out what happens from that.

Screen is very useful, but not really the right tool for what I think you want. The right tool is something similar to expect. I know you tried it before and had trouble, but I think it should work if you put a bit more effort into it. If you would like to work on the expect setup, you should start by seeing if you can run a simple expect script. After that, you can get it to run mplayer with almost no output.
 
Old 03-03-2007, 07:11 PM   #25
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Original Poster
Rep: Reputation: 34
Ok, I'll read the man pages of expect. nmh, from where did you learn all this stuff?
 
Old 03-04-2007, 12:01 AM   #26
nmh+linuxquestions.o
Member
 
Registered: Feb 2007
Posts: 135

Rep: Reputation: 15
Quote:
Originally Posted by gregorian
Ok, I'll read the man pages of expect. nmh, from where did you learn all this stuff?
In general, from using it to complete tasks (and researching/asking for help when needed). For this specifically, I looked at expect because I had heard of its uses for ssh/passwd/telnet/etc... when normal IO redirection does not work. I looked online for a few examples, read the man page and tried to get a sample to work for me.

I have found that there are many problems that are very easy to figure out simply by poking at them, reading the man/info pages, or reading examples online. I have also found that there are problems that are *very* difficult to solve without asking for help. The real trick is knowing which you are trying to solve.

Good luck with the expect stuff - and feel free to ask more questions if some of it does not make sense.
 
Old 06-23-2008, 09:41 AM   #27
shinybeast
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Rep: Reputation: 0
Lightbulb Getting too complicated??

If i am understanding correctly, the following command gives the effect you want:

mplayer <video_file> < /dev/null > /dev/null 2>&1 &

So just stick that in your script??


Earlier in the thread, you had the output redirected but the video just didn't play. Someone mentioned that mplayer wants to be connected to a terminal - and this was your problem, it wasn't connected to any input, so it was hanging. " < /dev/null" connects /dev/null as standard input too.
 
Old 06-23-2008, 09:44 AM   #28
shinybeast
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Rep: Reputation: 0
Late to the party

Right, just noticed the dates on the previous postings.
 
  


Reply

Tags
automation, dcop, expect, kde, scripting, terminal



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
Shell scripting: Print output to logfile, error to logfile & screen stefanlasiewski Programming 18 05-22-2008 12:47 PM
init 3 ---> error output from wifi card is redirected to stdout koca Fedora 1 02-02-2007 08:01 AM
can output of tail be redirected? dsids Linux - Newbie 19 10-16-2006 02:19 AM
What is meant by " file > /dev/null 2>&1 </dev/null " attockonian Linux - Newbie 5 06-30-2006 10:51 PM
All output to /dev/null? Satriani Programming 13 10-17-2003 01:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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