dimanche 1 mars 2015

bash command to simply print new bash commandline like [tom@cerulean ~]$


My shell script used carriage return '\r' to erase my current [tom@cerulean ~]$ bash line to print an information (that is run asynchronously then returned when done). I want something that will to simulate 'enter' and create new [tom@cerulean ~]$ on the next line. How can I do that?


Start:



//.bashrc welcome page like archey
[tom@cerulean ~]$ //cursor here


The /r carriage return from asynchronous function that will erase [tom@cerulean ~]$ line and prints a message.



//.bashrc welcome page like archey
Your packages is up to date //the cursor is still here


What I want



//.bashrc welcome page like archey
Your packages is up to date
[tom@cerulean ~]$ //cursor here


When I type something else, it will just append everything to that line. Adding \n still doesn't make it more cleaner. I want it to simply print [tom@cerulean ~]$



Aucun commentaire:

Enregistrer un commentaire