LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bath-Files under linux (https://www.linuxquestions.org/questions/linux-newbie-8/bath-files-under-linux-430536/)

mashed 04-01-2006 12:01 AM

Bath-Files under linux
 
How do you create bath files under linux (I mean like .bat files under dos systems)

I need this information for two purposes:

1) To make shortcuts to video files (so that I can set some parameters for the player and freely choose player) This I can probably do with symbolic links or something I supose

2) To transconde multiple videos using ffmpeg comman line input.

Also I would like to know how to setup bath file in linux so, that computer doesn't start new task before the first is finished.

Still I would like to know the console command to shut down the computer (so that I can setup computer to shut down when the bath file is finished)

sumguy231 04-01-2006 12:37 AM

In Linux, the equivalent of a batch file is a shell script. Assuming you're using BASH, I'd suggest you look at this good begginner's guide:
http://www.google.com/url?sa=t&ct=re...-Zqv4XszKAZCPA
Quote:

Still I would like to know the console command to shut down the computer (so that I can setup computer to shut down when the bath file is finished)
Use (as root):
Code:

#shutdown -h now

nilleso 04-01-2006 12:44 AM

Quote:

Originally Posted by mashed
1) To make shortcuts to video files (so that I can set some parameters for the player and freely choose player) This I can probably do with symbolic links or something I supose

What you are looking for here is likely a launcher. Read up on launchers in your window manager's (ie gnome/kde/etc) documentation. This could also be accomplished with a shell script
Quote:

Originally Posted by mashed
2) To transconde multiple videos using ffmpeg comman line input.

Again, investigate shell scripts or have a look at my next response to your next question.
Quote:

Originally Posted by mashed
Also I would like to know how to setup bath file in linux so, that computer doesn't start new task before the first is finished.

shell scripts are processed sequentially. or from the command line, you can use the following operators which will wait for each command to be processed sucessfully before moving on to the next
echo 1 && sleep 3 && echo sleeped_3 && echo 4 && ls -la

Quote:

Originally Posted by mashed
Still I would like to know the console command to shut down the computer (so that I can setup computer to shut down when the bath file is finished)

the following command (as root) will shutdown the computer (in most Linux distributions):
shutdown -h now
or -r to reboot... man shutdown for more info.

What your asking for will require you to do some investigation and some trial and error... there are no simple answers.
If you have some real examples that you would like help writing a shell script around, there are many of us here who can help.

good luck
cheers:)

archtoad6 04-01-2006 07:55 AM

Sorry, the phrase "bath file" bugs me a lot -- In Win, it's a batch file, & in Linux a bash file.

I suppose a bath file, if it existed, would be one that would run on either system. This can be done, I have, but it's pointless, except as a learning exercise.

demented_are_go 04-01-2006 07:59 AM

I just had to... can you use bath files to get rid of windows viruses?

archtoad6 04-01-2006 08:32 AM

Thanks for the chuckle.

cs-cam 04-01-2006 09:00 AM

Quote:

in Linux a bash file
Since we're being anal, who says bash is the only shell in linux? I run zsh, are you discriminating against my shell of choice? I think that "shell script" is probably the correct term.

mashed 04-02-2006 12:25 PM

Thanks for the help


All times are GMT -5. The time now is 07:00 AM.