[英]Creating commands and executing them through linux terminal
I participate in competitive programming contests like codechef. 我参加诸如Codechef之类的竞争性编程比赛。 So they take input in a specific format.
因此,它们以特定格式进行输入。 I am looking to develop a tester in C++.
我正在寻找用C ++开发测试仪。 Some things I plan to do are:
我打算做的一些事情是:
After having done all this, I want a command to represent all the above operations. 完成所有这些操作后,我想要一个命令来代表以上所有操作。 How do I introduce a new command( for example
test_codechef sample_program.cpp
where new command executes my tester on sample_program.txt) in the linux terminal? 如何在Linux终端中引入一个新命令(例如
test_codechef sample_program.cpp
,其中新命令在sample_program.txt上执行我的测试器)?
I think you want to add a command to Terminal and use it , if you're talking about Bash then just create a file without a type example for bash file : 我认为您想向Terminal添加一个命令并使用它,如果您谈论的是Bash,则只需创建一个不带bash文件类型示例的文件:
#!/bin/bash
echo "Hello World "
save: HelloWorld 保存:HelloWorld
after: 后:
chmod +x HelloWorld
cp HelloWorld /usr/bin/
then type on Terminal : HelloWorld
, and the result Hello World , so if I'm going correct you need to learn some stuff about Bash Linux 然后在Terminal上输入:
HelloWorld
,然后输入Hello World,所以如果我要正确的话,您需要学习一些有关Bash Linux的知识
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.