LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-26-2014, 11:01 PM   #1
drpaudel
LQ Newbie
 
Registered: Mar 2008
Posts: 15

Rep: Reputation: 0
Auto Execute Command


I am a newbie to scripting. I want to start following command automatically from shell scripting.


Code:
vlc -vvv http://youtu.be/O7dHeeeYe --sout=#udp{dst=192.168.1.1:10101} --sout-all --sout-keep
What is the procedure?
 
Old 06-26-2014, 11:27 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

open a text file in an editor, put the following in it:
Code:
#!/bin/sh
vlc -vvv http://youtu.be/O7dHeeeYe --sout=#udp{dst=192.168.1.1:10101} --sout-all --sout-keep
Save the file and make it executable.

Probably a good time to read a shell scripting for beginners type tutorial.

Evo2.
 
1 members found this post helpful.
Old 06-26-2014, 11:57 PM   #3
drpaudel
LQ Newbie
 
Registered: Mar 2008
Posts: 15

Original Poster
Rep: Reputation: 0
if the file name is test.sh how can it be executed in system restart.
 
Old 06-27-2014, 12:12 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

there are various distro specific ways (and you didn't mention what distro you are using), but a simple way that will work almost everywhere is with a crontab entry like
Code:
@reboot /path/to/test.sh
Put "crontab howto" into your favourite search engine for instructions on editing your crontab.

HTH,

Evo2.
 
1 members found this post helpful.
  


Reply

Tags
autostart, bash, shell scripting


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
could not execute auto chekc for display colors Welcome12 Linux - Newbie 1 09-11-2012 05:53 PM
Execute a command , reboot and then execute another command ganeshp@moris.org Linux - Newbie 3 12-03-2008 01:51 AM
Auto-execute script ishcoleobo Linux - Software 2 12-10-2005 07:26 PM
auto execute shell script ykirankumar Linux - Software 3 09-22-2004 08:23 AM
auto-execute programs in graphical mode ? manub Linux - Newbie 12 02-02-2003 07:41 AM


All times are GMT -5. The time now is 07:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration