Some of the output redirected to /dev/null appears on the screen while 'scripting'
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.