Can a bash script prepopulate the prompt with a co

2020-02-02 03:47发布

I run multiple bash script for FFmpeg. However, since I have several windows open, I lose track of what file I ran since I execute the file directly from the script there is no history of what I ran. The only history there is the first file I called

for example:

enter tv number i.e 19: 19
 stream key: key
 Press [enter] to execute tv19

I press enter, and it runs tv19 but there is no record I ran tv19 in that window, so how can I echo the command to the $

like this

[ibrod ~]$ ./tv19

than I can press enter and use the up arrow than I know what file I ran in that putty window.

标签: bash
1条回答
我欲成王,谁敢阻挡
2楼-- · 2020-02-02 04:06

Thanks for the help, I figured another way. I change the prompt like [tv10 ~]$

just made a file changetv i put inside

PS1="[$1 \W]\$ "

so I run the file and call it as

. ./changetv tv10

so now I know what window is what. :)

查看更多
登录 后发表回答