一般浏览器 按F12 弹出的菜单窗口处 Console可以进行简单的交互,
复杂的话可能需要下载浏览器的扩展程序插件或者自己写工具
B. 怎样在shell程序中处理交互式命令
用相应命令的交互使用参数不就可以了吗?
su :
su - username -c "command"
passwd:
echo "newpasswd"|passwd user --stdin
大部分需要交互使用的命令都有非交互参数,使用前先看看man ,实在没有的才需要expect
C. 如何用Perl实现命令行交互
如果只是执行perl脚本的话交互用STDIN来读取就可以了,调用外部命令的交互可以用管道或者IPC
D. 什么叫命令行交互方式
纯粹敲代码命令,无GUI界面的那种,比如在cmd下敲命令
E. 怎么用python对一个交互式的命令行程序进行交互
在cmd里运行这个交互式程序
然后其他就和python和cmd下的程序打交道一样了
比如:
开本机telnet或ssh服务
通过python telnet或ssh到本机,荣国write启动这个交互式程序,开始write and receive就好
F. linux的cp命令的交互式用法和强制覆盖用法的问题(2)
默认root环境下执行alias就能知道
aliascp='cp-i'
aliasl.='ls-d.*--color=auto'
aliasll='ls-l--color=auto'
aliasls='ls--color=auto'
aliasmv='mv-i'
aliasrm='rm-i'
aliassudo='sudo-E'
aliaswhich='alias|/usr/bin/which--tty-only--read-alias--show-dot--show-tilde'
但是普通用户没这个,如果你在root用户下不想交互式可以用绝对命令
cp mv 像这样命令前加个‘’就好了
G. 如何与命令行进行交互
简单的方法是用批命令。用bat把所有运行程序串起来。 bat 中用 START 命令 控制单个程序运行的优先级及保证一个程序运行完毕再运行下一个程序 例如 start /B /high /wait cmd /c my_prog1 par1 par2 ... 当然,用 system() 也可以调 bat。
H. C#怎么与命令行工具交互
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
namespace RunCMD
{
/**
* 作者:周公
* blog:http://blog.csdn.net/zhoufoxcn
* 日期:2007-07-07
*
* */
public partial class CMDForm : Form
{
public CMDForm()
{
InitializeComponent();
}
private void btnExecute_Click(object sender, EventArgs e)
{
tbResult.Text = "";
ProcessStartInfo start = new ProcessStartInfo("Ping.exe");//设置运行的命令行文件问ping.exe文件,这个文件系统会自己找到
//如果是其它exe文件,则有可能需要指定详细路径,如运行winRar.exe
start.Arguments = txtCommand.Text;//设置命令参数
start.CreateNoWindow = true;//不显示dos命令行窗口
start.RedirectStandardOutput = true;//
start.RedirectStandardInput = true;//
start.UseShellExecute = false;//是否指定操作系统外壳进程启动程序
Process p=Process.Start(start);
StreamReader reader = p.StandardOutput;//截取输出流
string line = reader.ReadLine();//每次读取一行
while (!reader.EndOfStream)
{
tbResult.AppendText(line+" ");
line = reader.ReadLine();
}
p.WaitForExit();//等待程序执行完退出进程
p.Close();//关闭进程
reader.Close();//关闭流
}
}
}
I. 如何进入sqlplus 命令交互状态
我的做法是捕获sqlplus的输出来判断connection string是否合法。
连接上的话执行exit退出:
echo "exit" | sqlplus -s connection_string >out.dat 2>&1
然后查看out.dat里面是否有错误信息。
如: wc -l out.dat | awk '{print $1}'