giovedì 19 gennaio 2017

Riprendere la modalità interattiva dopo Ctrl-Z

Con questo post voglio ricordare una "simpatica" esperienza con la consolle di Linux.
Durante il normale utilizzo di VIM per la modifica di uno script ho per errore premuto Ctrl-Z e il risutato è che sono tornato alla shell con il timore di aver perso tutto ciò che avevo appena digitato.

Panico :-0

E così che ho scoperto il comando "fg" che consente di recuperare la modalità interattiva.

fg [jobspec] : Resume jobspec in the foreground, and make it the current job. If jobspec is not present, the shell’s notion of the current job is used. The return value is that of the command placed into the foreground, or failure if run when job control is disabled or, when run with job control enabled, if jobspec does not specify a valid job or jobspec specifies a job that was started without job control.