Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7744823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:51:38+00:00 2026-06-01T09:51:38+00:00

Below is my code, which behaves extremely bizarre, and I am not sure I

  • 0

Below is my code, which behaves extremely bizarre, and I am not sure I understand the reason, but I think it’s somehow connected to path expansion:

EDIT: this is the asxgrab script mentioned in the second listing:

#!/usr/bin/env bash

let "i=0"

GET "$1" | grep 'href="mms://' | while read line
do
    echo "$line"
    address=`echo $line | grep -Eow '"[^"]+"'`
    address_length=$((${#address}-2))
    address=${address:1:address_length}
    echo "Grabbing '$address', attempt $i, $address_length"
    mplayer "'$address' -dumpstream -dumpfile '$2.wmv' -vf scale\=320\:240" > /dev/null
    if [ ! $? ]; then
        break 1
    fi
    let "i++"
done

I’ve tried dozens of different ways of escaping, quoting and whatnot, and I think I’ve exhausted my creativity… please help!

Suppose the script is called with these arguments:

./asxgrab 'http://switch3.castup.net/cunet/gm.asp?ai=16&ip=79.180.37.230&course=c20478/2012b&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183&ar=c20478_12b_784_01_1&ticket=58353E7A69BF1B9XO655E9E683016C5255C08DD37211ECF495F72A64E5278AA434CSP3C10C028D604AAD6C39FE7D71386D230983BBAF58A2511D14222F95090AE2C4C55CB696B82919A5A8EB44EAF8954DEDB5' 'java.0'

The received response looks like this:

<asx version="3.0">
    <!-- GMX -->
    <param name="encoding" value="utf-8" />
    <title>CastUP: c20478_12b_784_01_1</title>
    <MOREINFO HREF = "" />

    <entry>
    <PARAM NAME="EntryType" VALUE="Content" />

    <param name="encoding" value="utf-8" />
    <PARAM NAME="CastUP_AssociatedURL" VALUE="" />
    <PARAM NAME="CastUP_Content_Config" VALUE="" />
    <PARAM NAME="CastUP_Content_ClipMediaID" VALUE="9067325" />
    <author>openu</author>
        <title>CastUP: c20478_12b_784_01_1</title>
<ref href="mms://s3fwm.castup.net/server12/16/798/79837168-61.wmv?ct=IL&rg=BZ&aid=16&ts=0&cu=FE81687B-33CD-4441-A8F6-1DEC9923332C&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183" />
<ref href="...." />

    </entry>

When I do this:

mplayer "mms://s3fwm.castup.net/server12/16/798/79837168-61.wmv?ct=IL&rg=BZ&aid=16&ts=0&cu=C6527A33-587F-4148-A3D2-E7EDED51316B&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183" -dumpstream -dumpfile java0.wmv -vf scale=320:240

from the terminal, it works, but it doesn’t work from the script. Instead it tries to trim the $line or something like that. I don’t even understand what happens, but the output is absolutely of no consequences…

This is my uni’s site and this is, funny as it gets, a lecture on Java 🙂

EDIT:

<ref href="mms://s0dwm.castup.net/server12/16/798/79837168-61.wmv?ct=IL&rg=BZ&aid=16&ts=0&cu=111A3770-29DC-40EC-85EC-93453E2819D7&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183" />
Grabbing 'mms://s0dwm.castup.net/server12/16/798/79837168-61.wmv?ct=IL&rg=BZ&aid=16&ts=0&cu=111A3770-29DC-40EC-85EC-93453E2819D7&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183', attempt 0, 268
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
No stream found to handle url 'mms://s0dwm.castup.net/server12/16/798/79837168-61.wmv?ct=IL&rg=BZ&aid=16&ts=0&cu=111A3770-29DC-40EC-85EC-93453E2819D7&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183' -dumpstream -dumpfile 'java.0.wmv' -vf scale=320:240
d324d1043027b0720c295b93e4abb183" />
Grabbing '', attempt 1, -2
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
File not found: ''' -dumpstream -dumpfile 'java.0.wmv' -vf scale=320:240'
Failed to open '' -dumpstream -dumpfile 'java.0.wmv' -vf scale=320:240.
027b0720c295b93e4abb183" />

This is the output I’m getting from the script.

MPlayer SVN-r31918 (C) 2000-2010 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing mms://s3fwm.castup.net/server12/16/798/79837168-61.wmv?ct=IL&rg=BZ&aid=16&ts=0&cu=C6527A33-587F-4148-A3D2-E7EDED51316B&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183.
STREAM_ASF, URL: mms://s3fwm.castup.net/server12/16/798/79837168-61.wmv?ct=IL&rg=BZ&aid=16&ts=0&cu=C6527A33-587F-4148-A3D2-E7EDED51316B&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183&cuud=user:77f6c69526b9fa05f78d3d6679630308d324d1043027b0720c295b93e4abb183
Resolving s3fwm.castup.net for AF_INET6...

Couldn't resolve name for AF_INET6: s3fwm.castup.net
Resolving s3fwm.castup.net for AF_INET...
Connecting to server s3fwm.castup.net[212.179.13.65]: 1755...

Connected
file object, packet length = 6100 (6100)
unknown object
unknown object
unknown object
stream object, stream ID: 1
stream object, stream ID: 2
unknown object
data object
mmst packet_length = 6100
Cache size set to 64 KBytes
Stream not seekable!

And this is the expected output.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:51:39+00:00Added an answer on June 1, 2026 at 9:51 am

    Have you tried this?

    mplayer "$address" -dumpstream -dumpfile "$2.wmv" -vf "scale=320:240" > /dev/null
    

    Secrets of bash:

    • Variables inside double-quotes are expanded; those inside single-quotes are not.
    • Words inside quotes are treated as a single token.
    • Quotes of one type escape those of the other type.

    The original line

    mplayer "'$address' -dumpstream -dumpfile '$2.wmv' -vf scale\=320\:240" > /dev/null
    

    called mplayer with the single argument '$address' -dumpstream -dumpfile '$2.wmv' -vf scale\=320\:240, but mplayer wants each of those tokens to be a separate word.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use below code which works fine for me in FF but Problem in
I am using the below code which is working fine in chrome, IE but
Currently i'm using below code which works well. $(#topperAtBaseLevel:visible, #lowerAtBaseLevel:visible, #midAtBaseLevel).hide(); any optimised code?
I have below code which overrides equals() and hashcode() methods. public boolean equals(Object obj)
Can anyone help me to rewrite the below code which use a fade effect
I want to know is below code correct ? I have following code which
Which code snippet will give better performance? The below code segments were written in
Below is the code which I wrote to display a tooltip content. As the
Hi All below is the code which i use. <!DOCTYPE html PUBLIC -//W3C//DTD XHTML
I have wrote the code below which was taken from Java How to program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.