prompt

In Windows cmd, how do I prompt for user input and use the result in another command?

人盡茶涼 提交于 2019-11-26 11:31:13
I have a Windows .bat file which I would like to accept user input and then use the results of that input as part of the call to additional commands. For example, I'd like to accept a process ID from the user, and then run jstack against that ID, putting the results of the jstack call into a file. However, when I try this, it doesn't work. Here's my sample bat file contents: @echo off set /p id=Enter ID: echo %id% jstack > jstack.txt and here's what shows up in jstack.txt: Enter ID: Terminate batch job (Y/N)? Instantsoup Try this: @echo off set /p id="Enter ID: " You can then use %id% as a

Sql Server利器sql prompt

僤鯓⒐⒋嵵緔 提交于 2019-11-26 11:12:35
  看完园子里 VAllen 介绍sql prompt博文 Red Gate系列之三 SQL Server 开发利器 SQL Prompt 5.3.4.1 Edition T-SQL智能感知分析器 完全破解+使用教程 后,结合自己的使用做些补充备忘。 解决问题 解决Sql Server Management Studio 中无法格式化Sql语句问题。原来切换到PL/Sql Developer中格式化Sql语句的日子终于结束了。 每次打select * from xxx,噼里啪啦一通打的过快导致字母顺序错乱、空格位置不对以致重新修改时,那个胸闷哦!好了现在ssf直接完成。 快捷列出表详细列名 安装地址   安装地址: http://down.liangchan.net/SQL+Prompt+v5.3+v6.1.rar   下载后根据Readme.txt内容安装和输入注册码。 使用介绍   1. 格式化Sql语句,选中后快捷键Ctrl+k+Y,貌似不支持自定义快捷键。      2. Expand Wildcards,列出表详细列名      3. 自定义语句,ssf ->select * from 。在菜单中Snippet Manager中设置查看。          我习惯ssf打完按空格,在Options设置      转载于:https://www.cnblogs.com

Sum of two numbers with prompt

江枫思渺然 提交于 2019-11-26 09:55:30
问题 I\'ve been trying to solve this problem for the last couple days: when I subtract, multiply or divide 2 numbers input through a prompt, everything works fine; but when I want to add them, I get the 2 numbers simply written together. Example: if I add 5 and 6, I get 56!! Here\'s the code I\'m working with. var a = prompt(\"Enter first number\"); var b = prompt(\"Enter second number\"); alert(a + b); What am I doing wrong? Do I have to specify the value type? 回答1: The function prompt returns a

How can I make an expect script prompt for a password?

爱⌒轻易说出口 提交于 2019-11-26 07:37:10
问题 I have an expect script that connects to a few routers through ssh. All these routers have the same password (I know, it\'s wrong), and the script needs to know that password in order to be able to connect to the routers. Currently, the password is passed to my script as an argument on the command line, but this means that there\'s a trace of that password in my .bash_history file as well as in the running processes. So instead I would like the user to be prompted for a password, if possible

Have bash script answer interactive prompts

ぃ、小莉子 提交于 2019-11-26 04:38:19
问题 Is it possible to have a bash script automatically handle prompts that would normally be presented to the user with default actions? Currently I am using a bash script to call an in-house tool that will display prompts to the user (prompting for Y/N) to complete actions, however the script I\'m writing needs to be completely \"hands-off\", so I need a way to send Y|N to the prompt to allow the program to continue execution. Is this possible? 回答1: This is not "auto-completion", this is

Read password from stdin

瘦欲@ 提交于 2019-11-26 04:10:42
问题 Scenario: An interactive CLI Python program, that is in need for a password. That means also, there\'s no GUI solution possible. In bash I could get a password read in without re-prompting it on screen via read -s Is there something similar for Python? I.e., password = raw_input(\'Password: \', dont_print_statement_back_to_screen) Alternative: Replace the typed characters with \'*\' before sending them back to screen (aka browser\' style). 回答1: >>> import getpass >>> pw = getpass.getpass()

Detecting Unsaved Changes

戏子无情 提交于 2019-11-26 03:37:06
问题 I have a requirement to implement an \"Unsaved Changes\" prompt in an ASP .Net application. If a user modifies controls on a web form, and attempts to navigate away before saving, a prompt should appear warning them that they have unsaved changes, and give them the option to cancel and stay on the current page. The prompt should not display if the user hasn\'t touched any of the controls. Ideally I\'d like to implement this in JavaScript, but before I go down the path of rolling my own code,

In Windows cmd, how do I prompt for user input and use the result in another command?

爷,独闯天下 提交于 2019-11-26 02:27:12
问题 I have a Windows .bat file which I would like to accept user input and then use the results of that input as part of the call to additional commands. For example, I\'d like to accept a process ID from the user, and then run jstack against that ID, putting the results of the jstack call into a file. However, when I try this, it doesn\'t work. Here\'s my sample bat file contents: @echo off set /p id=Enter ID: echo %id% jstack > jstack.txt and here\'s what shows up in jstack.txt: Enter ID:

Command to run a .bat file

浪子不回头ぞ 提交于 2019-11-26 00:55:49
问题 I\'m trying to make my Visual Studio build script execute a .bat file that does something important. Here is what I\'m want to do right now: cd \"F:\\- Big Packets -\\kitterengine\\Common\\\" Template.bat But it doesn\'t work. I have to do this to make it work: cd \"F:\\- Big Packets -\\kitterengine\\Common\\\" F: Template.bat But this is pretty difficult to add to the Visual Studio script. How can I do this in one single line? 回答1: Can refer to here: https://ss64.com/nt/start.html start ""

Run Command Prompt Commands

社会主义新天地 提交于 2019-11-25 23:56:43
问题 Is there any way to run command prompt commands from within a C# application? If so how would I do the following: copy /b Image1.jpg + Archive.rar Image2.jpg This basically embeds an RAR file within JPG image. I was just wondering if there was a way to do this automatically in C#. 回答1: this is all you have to do run shell commands from C# string strCmdText; strCmdText= "/C copy /b Image1.jpg + Archive.rar Image2.jpg"; System.Diagnostics.Process.Start("CMD.exe",strCmdText); EDIT: This is to