Basically, I have a perl script that calls enables one to resume where a video file left off (i.e. where the user stopped playback) that chokes on files that are located in a path that contains spaces.
To make the situation a little more complicated, the perl script gets help from a bash script that analyzes the video file in question and passes file-specific switches to mplayer.
Both scripts need to be in the same dir and you must run them from that dir!
Here is the usage:
(You can use any video format that mplayer can play, like mpg, mkv, etc.)
The problem occurs when the path to the video file contains a space. The perl script doesn't handle it and passes the incorrect options to the file.
Example: I go to play ‘Test.mkv' located in /media/D/New\ CD/
Can someone have a look at the code and help me fix this? I just don't know that much about perl to be useful.
Code to mplayer-resumer-vdpau.pl Code to vdpau-detector
It gave the same error... it must be something in how the perl script is calling the bash script because the bash script works just fine in dirs with and without spaces....
I would like to iterate over `dirs`in a script, but the script will never show more than one (current) folder
#! /bin/bash
for i in `dirs`
do
echo ${i}
done
echo ++++++++++++++++++
for i in $( dirs -p )
do
echo ${i}
done
echo ------------------
dirscontent=`dirs`
echo... (5 Replies)
The following command to replace text in place in multiple files in a directory is tripping up on filename spaces (Windows environment). I really don't know Perl.
find '\\server\directory' | xargs perl -pi -e 's/textA/textB/g'Mike (2 Replies)
Example data
The sub and array in question
sub parse_status {
my $status_info = shift;
my @info;
push @info,"$1\n" if $status_info =~ /(System State : +)/;
push @info, "System_Uptime : $1\n" if $status_info =~ /Uptime:.+?up (.+?), load/;
push @info, "$1\n" if $status_info =~... (2 Replies)
I have a variable
I want to remove the spaces in between.
The output should be
How can this be done
Any help will be appreciated. Thanks in advance (1 Reply)
I am trying to get a listing of ALL directories only under /export (as an example). I can get all the dirs directly under /export but I need any sub dirs under those dirs. I've looked (here and google) but can not find anything that works (4 Replies)
Hello,
Recently, I've started with shell scripting, and decided to write a script for my system backup using tar. When I was dealing with tar execution inside shell script I found this, inside shell we have the following code:
tar $TAR_PARAMS $ARCHIVE_FILE $EXCLUDE $BACKUP_STARTwith... (6 Replies)
Hi All,
I have a file with the following contents with multiple lines
172445957| 000005911|8| 400 Peninsula Ave.#1551 | And,K |935172445957|000005911
607573888 |000098536 | 2|Ane, B |J |Ane |1868 |19861206|20090106|20071001
I want to trim the "leading and trailing spaces only" from... (2 Replies)
I have a directory which is /home/mark/files/ , inside this particular I have a bunch of filles (see examples below)
TST_SHU_00014460_20090302.txt
TST_SHU_00016047_20090302.txt
TST_SHU_00007838_20090303.txt
TST_SHU_00056485_20090303.txt
TST_SHU_00014460_20090303.txt... (2 Replies)
hi,
I would like to know of a shell script to create the following
A script which will take in two parameters i.e. name of file and SID and create directories named /opt/oracle/admin/$SID/{bdump,cdump,udump}. Then edit the init file and change the three lines that look like this.
... (2 Replies)