命令行参数和脚本参数区别?

sh/bash/dash/ksh/zsh等Shell脚本
回复
giveup
帖子: 127
注册时间: 2009-08-31 17:21

命令行参数和脚本参数区别?

#1

帖子 giveup » 2011-12-05 15:18

我在命令行直接输入

代码: 全选

mplayer 17291.mp3
能正常播放该首MP3。
想命令行直接播放一个目录。然而直接输入

代码: 全选

find *.mp3 | while read f; do echo $f; mplayer $f; done
则会停留在播放界面上,没有任何声音,也不播放。按q键不能退出,只有ctrl+C。是mplayer的问题,还是脚本解释器的问题?
环境:ubuntu 11.10, dash, mplayer svn-r33713-4.6.1
字符输出如下:

代码: 全选

¥find *.mp3 | while read f; do echo $f; mplayer $f; done
17291.mp3
mplayer: Symbol `ff_codec_bmp_tags' has different size in shared object, consider re-linking
MPlayer SVN-r33713-4.6.1 (C) 2000-2011 MPlayer Team
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 17291.mp3.
Audio only file format detected.
Clip info:
 Title: Leave A Light On
 Artist: Joe Cocker[www.9ku.com]
 Album: ????? www.9ku.com
 Year: 2011
 Comment: ????? www.9ku.com
 Genre: Unknown
Load subtitles in ./
==========================================================================
Requested audio codec family [mpg123] (afm=mpg123) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, floatle, 64.0 kbit/2.27% (ratio: 8000->352800)
Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
==========================================================================
AO: [pulse] 44100Hz 2ch floatle (4 bytes per sample)
Video: no video
Mute: enabled
q^C  0.0 (00.0) of 274.0 (04:34.0) ??,?% 


MPlayer interrupted by signal 2 in module: pause

Exiting... (Quit)
头像
mjp123
帖子: 703
注册时间: 2009-04-09 15:06

Re: 命令行参数和脚本参数区别?

#2

帖子 mjp123 » 2011-12-05 15:48

直接mplayer *.mp3
头像
枫叶饭团
帖子: 14683
注册时间: 2010-06-16 1:05
系统: Mac OS X
来自: Tencent
联系:

Re: 命令行参数和脚本参数区别?

#3

帖子 枫叶饭团 » 2011-12-05 15:58

加exec试试?
giveup
帖子: 127
注册时间: 2009-08-31 17:21

Re: 命令行参数和脚本参数区别?

#4

帖子 giveup » 2011-12-07 21:32

mjp123 写了:直接mplayer *.mp3
管用,忘记尝试这个了 :em01
giveup
帖子: 127
注册时间: 2009-08-31 17:21

Re: 命令行参数和脚本参数区别?

#5

帖子 giveup » 2011-12-07 21:38

枫叶饭团 写了:加exec试试?
很奇怪。
我的ubuntu系统是装在usb硬盘上的。在acer 4710z上不能正常播放,在IdeaPad S205上居然能播放。不过只能播放一个文件就退出。
回复