I try to write a simple script and store all my favor commands such as grep, find, sed.
when I use history command in shell, I can show all the historical commands with (history) I can reuse the the symbol '!'(Exclamation) to get my old commands:
Let's assume 2099 -> ls -lah (in my history)
>!2099 <- ENTER >ls -la[CURSOR]
when I type
'!2099 <- ENTER',
'ls -la[CURSOR]' in the next line.
does anyone know how to implement it on shell script?
I have tried to remove the
'\r' from the input string, but it does't work so far.