Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
.bashrc引数を指定して 2 つのコマンドを実行できるようにエイリアスを作成するにはどうすればよいですか?
.bashrc
たとえば、ソースをコンパイルして実行します。
gcc-run -lm example.c
走るだろう
gcc -lm example.c ./a.out
私が見つけた最も近いのはこの質問でしたが、引数はありません。
引数を渡したい場合、エイリアスは使用できません。シェル関数を使用する必要があります。あなたは似たようなものが欲しいようです
gcc-run () { gcc "$@" ./a.out }