Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: ttz on September 24, 2015, 02:41:41 PM

Title: bash script does not return to prompt
Post by: ttz on September 24, 2015, 02:41:41 PM
Code: [Select]
> 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;

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?

Title: Re: bash script does not return to prompt
Post by: gerald_clark on September 24, 2015, 05:04:13 PM
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.
Title: Re: bash script does not return to prompt
Post by: ttz on September 24, 2015, 05:43:29 PM
@gerald_clark
ur right, ls gave me what ls gives plus new prompt. now what?
Title: Re: bash script does not return to prompt
Post by: ttz on September 24, 2015, 06:09:11 PM
oh, now don't i feel foolish! the whole of my prob was wrong expectation. i changed script so that

Code: [Select]
printf "PM IS DONE\n";
does not have '\n'

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

gotta laugh...

thanks for humoring me.