command-line-interface

How to suppress output and check whether or not a command is successful?

五迷三道 提交于 2019-12-06 13:34:39
I am trying to write a powershell script that tests if a MySQL login is successful by using $? to check if an error occurs. I also want to suppress all output - successful or not successful - from the command. These are the things I've tried: mysql -u root --password=mypass -e "show databases" If ( $? ) { echo "Hooray!" } Else { echo "Boo!" } This works correctly but doesn't suppress any output. mysql -u root --password=mypass -e "show databases" > $null Works correctly still but does not suppress the errors if the password is wrong. mysql -u root --password=mypass -e "show databases" 2> $null

CCRC CLI lsactivity command

99封情书 提交于 2019-12-06 13:24:45
I have installed CCRC 7.1.1 with CLI . I was trying to get the list of activities using rcleartool command bit I could not find lsactivity command. Is there any equivalent command or any indirect way to achieve this targetM Also there is no -fmt option for " rcleartool desc " command? This was a very useful option in UCM but could not find in CCRC. Please help me with equivalent command in CCRC. Thanks, Raghav The commands supported by rcleartool are listed here . They don't include lsact . A potential workaround (not tested) would be to use describe -fmt . (see fmt_ccase , and the describe

npm install error ( npm install -g angular-cli ) in windows 10

Deadly 提交于 2019-12-06 12:43:42
node -v v4.5.0 npm -v 5.0.1 Has anyone faced this kind of issue while installing angular-cli in windows 10? Hamed Baatour Try the following: step 0: run this command npm uninstall -g @angular/cli npm cache clean step 1: delete this folder: C:\Users\%YOUR-USERNAME%\AppData\Roaming\npm step 2: uninstall Nodejs from Windows step 3: restart your PC step 4: install a fresh copy of Nodejs from here: https://nodejs.org/en/ step 5: install the CLI globally npm install -g @angular/cli@latest try this : $ npm remove -g angular-cli $ npm cache clean $ npm install -g angular-cli Check the path(npm -v,

How to enable PDO_MYSQL for CLI?

廉价感情. 提交于 2019-12-06 12:40:22
问题 I'm trying to learn the Symfony framework for PHP but having issues with the command line version of php. When trying to create the database tables: ./symfony doctrine:insert-sql I'm getting the following error: Couldn't locate driver named mysql This is only an issue with the command line version of php. I've had doctrine working no problem. After quickly reading up on the problem, it seems I need to enable PDO_MYSQL for the CLI installation of php. I've looked in the php.ini file and there

Windows 10 CLI UTF-8 encoding

為{幸葍}努か 提交于 2019-12-06 12:07:41
Problem: On an english Windows 10 using slovenian keyboard layout, all command line interfaces seem to have a problem with displaying (printing) UTF-8 characters, namely č, š and ž, which are replaced with ?. (I assume all UTF-8 specific characters, since ć and đ also do not work. ) Tested in: CMD, Powershell, Cmder on Windows 10 64-bit English - Slovenian keyboard layout ... unsuccessful Intellij IDEA on Windows 10 64-bit English language - Slovenian keyboard layout ... successful -> Works as needed in IDE, but not CLI. CMD Windows 10 64-bit English language - English keyboard ... successful

How to enable 'openssl' in UwAmp CLI?

ⅰ亾dé卋堺 提交于 2019-12-06 11:46:06
i have UwAmp installed. and i'm using php cli command with composer, it says 'you must enable openssl extension'. i'm sure i was enabled openssl in all php ini every version i have. how to enable openssl for uwamp cli? I had the same problem using UwAmp whilst trying to install composer, but found that I needed to add one more step before I could get it to work on my system. After you identify the php_uwamp.ini file and copy it to the same directory as php.ini (as suggested) you need to find the following line extension_dir = "{PHPEXTPATH}" and change it to extension_dir = "./ext" The

How to remove lines above and below an inverse grep match?

大兔子大兔子 提交于 2019-12-06 11:25:17
I'm working with some output that is more verbose than I'd like, so I was trying to use grep to whittle it down. The output looks something like this… path/to/file1: No Problems Found path/to/file3: Problem Found I'd like to filter out all the output concerning files without problems. I'm able to remove one line of it by piping the output through grep -v "No Problems Found" . I thought I'd then be able to use -B and -A along the lines of grep -B 1 -A 1 -v "No Problems Found" but it turns out those don't invert when used in conjunction with -v. I can modify the output pretty quickly in Vim,

Python: How to quit CLI when stuck in blocking raw_input?

拈花ヽ惹草 提交于 2019-12-06 11:20:17
I have a GUI program which should also be controllable via CLI (for monitoring). The CLI is implemented in a while loop using raw_input. If I quit the program via a GUI close button, it hangs in raw_input and does not quit until it gets an input. How can I immediately abort raw_input without entering an input? I run it on WinXP but I want it to be platform independent, it should also work within Eclipse since it is a developer tool. Python version is 2.6. I searched stackoverflow for hours and I know there are many answers to that topic, but is there really no platform independent solution to

CliBuilder argument without dash

旧城冷巷雨未停 提交于 2019-12-06 11:13:46
Using Groovy CliBuilder, ideally I would like to have an cmd-line as follows: ./MyProgram.groovy CommandName -arg1 -arg2 -arg3 Is is possible to parse pull out the CommandName as an argument using CliBuilder? You can do that if you set the property stopAtNonOption to false so that the parsing does not stop in CommandName . Then you can get the command from CliBuilder options . A tiny example below: def test(args) { def cli = new CliBuilder(usage: 'testOptions.groovy [command] -r -u', stopAtNonOption: false) cli.with { r longOpt: 'reverse', 'Reverse command' u longOpt: 'upper', 'Uppercase

Run cron job in CodeIgniter and Hostgator

一曲冷凌霜 提交于 2019-12-06 10:35:59
问题 I'm trying to run the follow cron job in codeigniter and hostgator /usr/bin/php /home/username/public_html/index.php cronjob contact martin But nothing happens, I receive the following email: <h4>A PHP Error was encountered</h4> <p>Severity: Notice</p> <p>Message: Undefined index: REMOTE_ADDR</p> <p>Filename: core/Input.php</p> <p>Line Number: 351</p> <p>Severity: Warning</p> <p>Message: Cannot modify header information - headers already sent by (output started at /home/iglesias/public_html