move "readwrite_task" function from 'main.c' to 'shell.c'