General TC > Programming & Scripting - Unofficial

bash script does not return to prompt

(1/1)

ttz:

--- Code: ---> more pm
#!/bin/bash
#find ~/music/|sort -R|head -n 30|xargs aplay
list=$(find ~/music/|sort -R|head -n 30)
echo $list | fold -s > pl;
echo $list|xargs aplay -q -c 5;
printf "PM IS DONE\n";
exit 0;
--- End code ---

it is intended to be the most stupid-simple music player. problem is that when it is done, i don't have a clean return to prompt; have to press enter to get new prompt.

it is about a year-and-half old and does everything i want except end well. if i can fix that, then done!

how to fix?

gerald_clark:
Usually that means something wrote over your prompt.
What happens if you run ls instead of hitting the return key?
If 'ls' is run, then it is an overwritten prompt.

ttz:
@gerald_clark
ur right, ls gave me what ls gives plus new prompt. now what?

ttz:
oh, now don't i feel foolish! the whole of my prob was wrong expectation. i changed script so that


--- Code: ---printf "PM IS DONE\n";
--- End code ---

does not have '\n'

now i see it! i had my prompt the whole time!!!!!!!!

gotta laugh...

thanks for humoring me.

Navigation

[0] Message Index

Go to full version