How to expand PS1?

后端 未结 7 1201
孤城傲影
孤城傲影 2020-11-27 17:57

I have a shell script that runs the same command in several directories (fgit). For each directory, I would like it to show the current prompt + the command which will be ru

7条回答
  •  一个人的身影
    2020-11-27 18:23

    You may have to write a small C program that uses the same code bash does (is it a library call?) to display that prompt, and just call the C program. Granted, that's not very portable since you'll have to compile it on each platform, but it's a possible solution.

提交回复
热议问题