I'm working on a script that will search through a directory for MKV files and remux them to MP4. I found a few other scripts around the net that do this, but they all have limitations that don't always get the job done. The main limitation I've found is that most scripts look for the video track in either the first track or the last track, which isn't always true. So I wanted a script that would work with any MKV file, no matter what track the video is on, and also copy all the audio/subtitle tracks, not just one audio and one video.
Whenever I run the script I get the following error for every file it tries to extract the tracks from using mkvextract:
Quote:
Error: Invalid track ID/file name specification in argument '4.mkv"'.
Whenever I type in the mkvextract command and run it myself it works perfect, so I'm not sure why the script has problems executing it.
It's a long script, and could probably be written better, but this is my first attempt at a bash script. I've only ever worked with Web Development languages in the past, so it hasn't been too difficult for me to get this far, but now I'm stuck...
It will be hard for anyone to help you with this long script. What I can propose to you is to run it with "bash -x yourscript" to get the shell to print out the commands while it is executing.
You may try to set the PS4 variable to something that is easy for you to debug your script.
The script worked perfectly fine, it just wouldn't execute the mkvextract command. However I found a fix... just send the mkvextract command to another file then execute that file. Not ideal, but it works.
I want to run commands inside a bash script.
An example is
I want to pass the command in a string as regexp as an argument to the script, then run sed on the bash variable
sed.sh regexp
sed.sh "-i \"s/<p>//g\""
then call
sed "$regexp" $fl (3 Replies)
Hi All,
Just have a requirement, I am executing a bash shell script, my requirement is to catch the pid and job name to a txt file in the same directory, is there anyway to do it? please help me out.
Regards
Rahul
---------- Post updated at 08:42 AM ---------- Previous update was at... (2 Replies)
Original script written on CentOS 6.3 with GNU bash 4.1.2
Destination system is Solaris 9 with GNU bash 2.05 (not changeable by me)
I have a script written on the linux side but now we need to provide a version to another site that "doesn't like linux". I've been going through changing the ] or... (13 Replies)
code:
IMAGE=$imgvalue;
if
then
echo DO=ABC;
elif
then echo DO=ETC;
elif
then echo DO=XYZ;
else
echo "$imgvalue is unsupported";
exit 1;
fi
in above script IMAGE=1 , IMAGE=2, IMAGE=3 whatever may be the value i have assigned it's showing only DO=ABC other conditions... (7 Replies)
Hello , i am using RHEL5 , i have got a perl script that executes and sends an email correctly if i run it with ./sendemail.sh command. This is the script below
#! /usr/bin/perl
use Net::SMTP;
print "starting email send .";
$smtp = Net::SMTP->new("192.168.0.1");... (2 Replies)
Hi,
I'm building an installation system that uses separate data
files that contain the individual characteristics of each package.
Within the data file, I would like to incorporate a section that
contains a bash script that is loaded into an array which is
then redirected to bash to be... (13 Replies)
Hi all, dummy here.... I have major errors on entering the shell. On login I get:
-bash: dircolors: command not found
-bash: tr: command not found
-bash: fgrep: command not found
-bash: grep: command not found
-bash: grep: command not found
-bash: id: command not found
-bash: [: =: unary... (12 Replies)
Hi all,
I am running a script on bash shell, although it gives me the desired output, it displays some errors at the prompt like
this directory doesnt exists
unary operator
etc etc
Is there someway to avoid these errors ??
Its very annoying to have these errors while the script is... (4 Replies)
Hi,
I tried a simple hello.cc program in Unix.
- Compiled with no errors
- Created a.out successfully
- While executing a.out, following error message appeared
" ld.so.1:a.out fatal: libstdc++.so.2.10.0: Open failed: No such file or directory Killed"
... (1 Reply)