I want to download an audio stream (curl STREAM > out.mp3 ) and analyse it. However, I don't want to store everything, but only the last x MB of this stream, after this everything can be deleted. So the out.mp3 file's maximal size is x MB and it contains the currently last x MB of the stream.
Can I do this with bash standard tools and so don't analyse the file size myself and using if-else statements?