一般瀏覽器 按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}'