FAQ Database Discussion Community


how does apache commons-cli parses \\t character

shell,command-line,command-line-interface,backslash,apache-commons-cli
I need to pass tab as an argument in commons-cli. When I give the argument as "\\t", the command line parser parses it as "\t" character itself but not TAB ( ) white space. How can I achieve this? Edit : As suggested by @centic, updating the question with how...

How -s option works actually in gcc compilers?

gcc,g++,command-line-interface
gcc & g++ provides command line option -s to reduce the size of executable file. But I want to know that how this -s option works exactly? What it does so that size of the executable reduces? How the size of file gets reduced?

Can't install heroku toolbelt on Linux Mint Path invalid

linux,bash,heroku,command-line-interface,heroku-toolbelt
Attemping wget -qO- https://toolbelt.heroku.com/install.sh | sh as instructed by this article yields this message. Add the Heroku CLI to your PATH using: $ echo 'PATH="/usr/local/heroku/bin:$PATH"' >> ~/.profile So I type echo 'PATH="/usr/local/heroku/bin:$PATH"' >> ~/.profile and I see that the string has been added to the .profile file, located at /home/myusername/...

Cisco Show command filtering

tcl,command-line-interface,show,cisco,cisco-ios
I am writing a script to capture certain lines of config from a cisco device. Unfortunately the buffer keeps getting filled up. So I was wondering if cisco devices can have 2 include statements. For example: show start | include vpn && protocol The 2 lines that I need info...

What are the different ways of submitting Hadoop jobs?

command-line-interface,oozie,hadoop2
I just know the below two ways of submitting Hadoop jobs 1) CLI(Command line interface) 2) OOzie Are there any other ways to do it ? and which is the most widely used method of submitting the Hadoop jobs?...

Laravel Artisan CLI doesn't set the right URL

php,command-line-interface,laravel-5,artisan
Synopsis I am having a little trouble understanding how Artisan works with environments and .env files. My problem is when I generate e-mails from a task on the command line which uses the url helper I am unable to generate the correct link. When I try to run the following...

How to create a directory on my cloudfoudry account?

lucene,cloud,command-line-interface,cloudfoundry
I deploy to cloudfoundry an application which need a directory for lucene. This application failed to start because there is not the configured directory. I search on Cloundfoundry forums but i did not found how to create a directory on my server on CloudFoundry. If someone have a documentation or...

swiftly generate and sort full encoding dictionary and corresponding primary radicals

character-encoding,command-line-interface,stanford-nlp
Chinese characters, according to the unihan encoding schema, can be indexed by their primary radical. The Stanford Word Segmenter has a command that can execute this, as described in their documentation i.e. java -cp stanford-segmenter-VERSION.jar edu.stanford.nlp.trees.international.pennchinese.RadicalMap -infile whitespace_seperated_chinese_characters.input > each_character_denoted_by_radical.output I want to create a comprehensive table of chinese characters...

CF CLI features that are enabled in Bluemix

command-line-interface,bluemix
There are a lot of cloud foundry features provided by CF CLI, that Bluemix platform has decided to disallow. CF_STAGING_TIMEOUT - Does not have any effect on Bluemix while uploading big war files. cf set quotas - Does not work on Bluemix. Delete organizations - Bluemix documentation says has to...

Multiple file input, with stdin // Argparse4j, Java

java,file,command-line-interface,command-line-arguments,stdin
I'm trying to use Argparse4j to build a command line utility. I need to create an option that accepts multiple input files, but also accepts stdin: subparser.addArgument("input") .nargs("*") .setDefault(Arrays.asList("-")) .type(Arguments.fileType().acceptSystemIn().verifyCanRead()); If I don't use Arrays.asList, then sometimes I get just a File object, instead of a List<File>. However, using nargs("*")...

Java program with referenced libraries: NoClassDefFound [duplicate]

java,jar,terminal,classpath,command-line-interface
This question already has an answer here: NoClassDefFound when trying to run java with external libraries 4 answers How do I run a program in Java, with several referenced libraries, .jar files, from a command line? I have put all my .jars in /lib folder, which is in the...

Convention on how pass multiple regexps on command line

regex,command-line-interface
I'm writing a small command line utility that will need to take several arguments each of which can be a list of regular expressions. Is there a convention on how to do that? Here is an example of what I have in mind mycliutility -i regexp1,regexp2 -o regexp3,regexp4 somefilename so...

Reading lines from .txt into batch file and handing into command line as arguments?

python,batch-file,command-line-interface,command-line-arguments
I need to read each line of a .txt file, line by line, handing in each line as an argument to a process I'm running in the CMD line interface. In the command line it would look like: "process c:/script.js arguments". I originally did this using Python: with open("C:\path\to\document.txt", "r")...

amazon EC2 command line interface not returning all my snapshots

amazon-web-services,amazon-ec2,command-line-interface
So I am tasked with creating a Batch script to handle creating and deleting snapshots of one of our servers. Well I have most of it working but the problem I am having is trying to list out more than 11 snapshots. We have well over 200 snapshots on one...

Updating Python CLI while maintaining “python -c exectfile” interface

python,interface,command-line-interface,execfile
I have a number of scripts that reference a Python program via the: python -c "execfile('myfile.py'); readFunc(param='myParam', input='blahblah')" interface. What I'd like to do is conceptually simple: Develop a more modular system with a "main" and a normal Python CLI interface that then calls these functions, but also MAINTAINS the...

Git for Windows equivalent for open current directory command

git,shell,command-line-interface,git-bash
I am using the Git for Windows "git bash" command line on Windows and can't seem to find an equivalent in it for the open current directory command "cmd ." I can't find any documentation but if someone can point me to a list of commands for Git for Windows...

Creating a shell command line application with Python and Click

python,command-line-interface,python-click
I'm using click (http://click.pocoo.org/3/) to create a command line application, but I don't know how to create a shell for this application. Suppose I'm writing a program called test and I have commands called subtest1 and subtest2 I was able to make it work from terminal like: $ test subtest1...

gnuplot command line arguments and call arguments

gnuplot,command-line-interface,interactive
following up from the question on SO about command line parameters to gnuplot scripts, and its corresponding answer, I see that I can make a script myscript.gp like if(!exist("parameters")) parameters="" plot "< myprog ".parameters u 1:2 and call it with $ gnuplot -e "parameters='-m 5'" myscript.gp However, I could achieve...

cordova run android executes fine. But Android 4.1.2 doesn't start the app

android,cordova,android-emulator,command-line-interface
I'm starting to develop and android app using Cordova 5.0.0 (cordova -v prints 5.0.0), and testing it on a Moto Razr D1 with Android 4.1.2. Under Windows 7, btw. cordova build and manually copying the platforms/android/build/output/apk/android-degug.apk to the SD and installing works fine. cordova emulate android runs fine on emulator...

Commons CLI is not honoring my command line setup

java,command-line-interface,apache-commons-cli
Using Apache Commons CLI 1.2 here. I have an executable JAR that needs to take 2 runtime options, fizz and buzz; both are strings that require arguments/values. I would like (if at all possible) my app to be executed like so: java -jar myapp.jar -fizz "Alrighty, then!" -buzz "Take care...

Export database from a remote server into a specific folder on my computer

php,mysql,database,shell,command-line-interface
I'm having trouble with a database export that is too big for phpmyadmin to handle. I'm curious what the syntax would be for exporting a mysql database from a remote server and getting the export file into a specific folder on my own computer, all using the command line. Say...

assertEqual not works when testing equals of command output

php,unit-testing,symfony2,phpunit,command-line-interface
Here is what I output in my command: $output->writeln("\033[37;42m Translations from " . $input->getArgument('bundle') . " imported successfully! \033[0m"); Here is what I get in command line with trim func to delete spaces: trim($commandTester->getDisplay()) ..string(69) " Translations from AcmeDemoBundle imported successfully! " But when I run this: $this->assertEquals(" Translations from...

How to see the installed version of Apache Mesos?

command-line-interface,mesos
How does one determine the installed version of Apache Mesos? mesos help on the cli doesn't say... mesos help Usage: mesos <command> [OPTIONS] Available commands: help log execute ps resolve cat local init-wrapper tail scp stop-cluster.sh start-masters.sh stop-slaves.sh slave start-cluster.sh stop-masters.sh daemon.sh master start-slaves.sh And no man. man mesos No...

Spring Shell - usage and execution

java,spring,spring-boot,command-line-interface,spring-shell
I want to integrate Spring Shell within a spring boot application. I am able to execute the examples from the official git-repo. But when migrating the example code to my own project that is very very similar to this code, my individual shell is not shown or usable. Instead the...

How to action a command from a PHP script in the current CLI context?

php,command-line-interface
Suppose I have a PHP script that prints time. echo time() . "\r\n"; Executing this script several times in CLI will look like this: curiosity:bin gajus$ php -r 'echo time() . "\r\n";' 1434453316 curiosity:bin gajus$ php -r 'echo time() . "\r\n";' 1434453318 curiosity:bin gajus$ php -r 'echo time() . "\r\n";'...

Install role services using command line

powershell,command-line-interface,windows-server-2012
I am taking a Windows Server class and I am supposed to install/uninstall some role services using CLI and PowerShell. Now it was easy to figure out using PowerShell since there are Install-WindowsFeature and Uninstall-WindowsFeature cmdlets. But my lab assignment is asking me to provide commands for the CLI. Is...

Clojure: how to tell if out is going to console or is being piped?

clojure,command-line-interface
I'm writing a clojure cli and would like to know if there is a way to test if the out (i.e. println) is being written to a console or is being piped to another program? This is similar to this question but for clojure....

PHP session_start function and CLI

php,command-line-interface,server
Function session_start used in PHP CLI print the next warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/robi/p/test.php:1) in /home/robi/p/test.php on line 2 why? I want to log all the client entries in a variable and check this out to see if i get...

Making a neat, installable Python library with Click

python,click,command-line-interface,setuptools
I'm trying to make a command line tool with Click in Python, and I can't seem to find any documentation on packaging up the library into something that's installable. Is there any way to do this? At the moment I'm just using a virtual environment and installing it for testing...

Stop Java Process if Running in Raspbian

java,command-line-interface,raspbian,application-shutdown
I want to make sure that a java process in Raspbian is stopped before launching a new instance of it. My approach, until now, has been to try to create a one-line command to stop the process from the command line, as it is the easiest way to include this...

AWS CLI and ECS query - HTTPSConnectionPool 443 error; Max retries exceeded; nodename nor servname provided, or not known

amazon-web-services,command-line-interface,aws-cli
Having some trouble with the aws ecs cli. Found some suggestions that this error message might be to do with region but as you can see the region is set in my config, and if I add the option '--region eu-west-1' to the cli I still receive the same error....

Can't launch a program from a different directory via Pexpect

python,bash,command-line-interface,pexpect
I have troubles launching a simple HelloWorld program via Pexpect module. I have a directory with the HelloWorld binary - hw, expect script - m.py, and a directory with the same script inside. ├── hw ├── m.py ├── main.cpp └── dir └── m.py Here is my expect script: import pexpect...

argparse optional value for argument

python,python-3.x,command-line-interface,argparse
I want to distinguish between these three cases: The flag is not present at all python example.py; The flag is present but without a value python example.py -t; and The flag is present and has a value python example.py -t ~/some/path. How can I do this with Python argparse? The...

how reliable is “at”

php,cron,command-line-interface,at-job
I'm working on a command line scheduler because I need to run several commands a few minutes after each other at different times. public static function set ($dir, $operation, $arguments = [], $options = [], $timeToWait) { $argumentstring = ''; $optionstring = ''; foreach($arguments as $argument) { $argumentstring .= $argument.'...

c++ 2 ref classes should have acess to one same object of a other class

c++,windows,reference,system,command-line-interface
I have 2 classes let's say class a und b. And even a thrid class c. class a and b should have acess to the functions of the same object of class c. I want to have a member like a reference. So the argument in the construktor of class...

Grunt change target based on input

gruntjs,command-line-interface
My Gruntfile is as follows: module.exports = function(grunt) { 'use strict'; var dictionary = { 'all' : '**', 'html5' : 'some/path' }; require('time-grunt')(grunt); require('load-grunt-tasks')(grunt); grunt.initConfig({ eslint : { options : { config : '.eslintrc' }, target : ['hello/world/js/<HERE>/**.js'] } }); grunt.registerTask('test', 'Lint a set of files', function(set) { set =...

ZF Error ZF tool setup

zend-framework,command-line-interface
Zend 1.9.1 so I get this error Blockquote ***************************** ZF ERROR ******************************** In order to run the zf command, you need to ensure that Zend Framework is inside your include_path. If you are running this without Zendframework in your include-path, you can alternatively set one of two enviroment variables to...

How to pass a hash as optional argument to -M in command line

perl,hash,package,command-line-interface
I know that when we need to pass some arguments to the use keyword after a package name we can pass them in the command line after the -M parameter. For example: use feature 'say'; say 'hello!'; can be invoked from the command line with >perl -Mfeature=say -e"say 'hello!'" But...

How do I create a node.js command line utility that uses gulp

node.js,command-line-interface,gulp
I've been working on a command line tool that is essentially a customized setup of gulp plus a custom gulp plugin. For a variety of reasons, I'd like to be able to kick off this process from within another Node application or from the command line. Is there a good...

DD WRT - Is there any option(SNMP /CLI) to get temperature of the router without using web interface?

ssh,command-line-interface,telnet,snmp,dd-wrt
The dd-wrt firmware is installed in the router. I can able to ssh/telnet to the router also I can able to snmpwalk to the router. How to get router temperature using SNMP or CLI (ssh/telnet) which is shown in web GUI?

Script saying two commands not found when they've been entered

bash,command-line,terminal,command-line-interface
I'm writing a bash script as the first part of an assignment. If the number of arguments is two, it's supposed to return the sum; if it's anything but two, it's supposed to return the error message and exit the script. But even when I enter two commands, it still...

GO support for building CLI tools using native system shell [closed]

shell,go,command-line-interface
I am planning to use GO to build a CLI tool executed in native system shell rather than a separate shell. What packages for GO can be used for this purpose other than codegangsta/cli ? Additionally, Is there any package to get REST API call support (such as curl) in...

cURL live output CLI

curl,output,command-line-interface
I try to have a "live output" of a web page in a shell script ; to explain, a little example : With this "localhost/index.php" like this: <?php header('Content-type: text/html; charset=utf-8'); echo 'Start<br />'.PHP_EOL; for( $i = 0 ; $i < 10 ; $i++ ) { echo '.'; flush();ob_flush(); sleep(1);...

How to get previous tag in git

git,tags,version,command-line-interface
I want to be able to roll back to a previous git tag without having to know what the current tag is or what the previous tag is. I know how to get the latest tag: git describe --abbrev=0 --tags but how would I get the tag right before it?...

Can't execute exec command (php / windows / ffmpeg)

php,windows,ffmpeg,exec,command-line-interface
I'm trying to run this command that does work in cli ffmpeg -i tmp1.flv -c:a copy -vf drawbox=:x=0:y=0:color=invert:t=2 output1.flv I was able to run only ffmpeg -version by php. $res = exec("C:\\wamp\\www\\ffmpeg\\bin\\ffmpeg.exe ffmpeg -version"); Location of tmp1.flv file: C:\wamp\www\tmp1.flv When I'm running $res = exec("chdir") => C:\wamp\www\ How can I...

Batch file get present working directory after cd command

windows,batch-file,cmd,command-line-interface,current-dir
When I run a batch file that lies in C:\some\dir I know I can use %cd% and %~dp0 to get the path of the batch file itself and other information as described here. But I have not managed to get the "present working directory" after the batch file has executed...

Execute code after script abort on CLI

php,command-line-interface
I try to execute some final code after my script got aborted in PHP. So let's say I have this PHP script: while(true) { echo 'loop'; sleep(1); } if I execute the script with $ php script.php it run's till the given execution time. Now I like to execute some...

AWS CLI not working on Mac OSX Yosemite

python-2.7,amazon-web-services,pip,amazon,command-line-interface
I've successfully downloaded the AWS CLI using PIP onto Mac OSX Yosemite. I'm running Python version 2.7. I can see the AWS executable in /Library/Frameworks/Python.framework/Versions/2.7/bin. But when I try to run aws help in my Terminal to test that the AWS CLI works, I get -bash: aws: command not found...

npm bin property is not working as expected

node.js,npm,command-line-interface
I wrote a simple 'addheader' node module and published it on npm. It contains a cli script which I registered in the package.json config-file in the bin property as follows: { "name" : "addheader", "bin" : "./addHeaderCli.js" } Installing the module with "npm install addheader" I can see the cli...

Create automatically from “*.coffee” “*.coffee.js” instead of “*.js”

coffeescript,command-line-interface
I use: > coffee -c myscript.coffee And in output I have myscript.js. I want to have myscript.coffee.js. Is there possibility to do it with help of coffee cli only?...

Remove e-mail string from the beginning of each row in a file

linux,shell,command-line-interface,cut
I have a file with the following format [email protected] some string with no set width [email protected] another string [email protected] yet another string!! [email protected] shortstring What I want to do is run a bash command that will get this file and remove the email+space from the beginning of EACH row and...

Change text on same CLI line Python [closed]

python,curl,command-line-interface
Like how some command line utilities are able to change text on a line without making a new line (like curl). How can I do that in Python?

Adapt GO build into different OS

go,command-line-interface,cloudfoundry
I need to evaluate 'GO' for my requirement of building a CLI tool which should be runnable in different OS s. How is this achieved in the CLI tools such as 'Cloud Foundry CLI'? How does GO handle this adaption into OSs?

C++ error C2440 when getting native pointer

c++,pointers,native,local,command-line-interface
Haven't write C++ code for long, and what I am trying to do is very simple. I'd like to create a local instance of a native class. Then pass a point to that class to another method. The code is as following: someclass instance(); someclass* pInstance = &instance; I am...

How can I save a user specifig config in a node module?

javascript,node.js,command-line-interface,config
I am trying to build a CLI with node (using commander.js) and I would like to save user specific configuration, so that a user only has to enter it on the first usage. How would I do this?

Unable to install plugins in cordova project

cordova,github,command-line-interface,cordova-plugins
Am facing a big issue : Unable to install the phonegap plugins in my cordova project.Actually it was working fine still yesterday. Now whenever I try adding any cordova plugin using CLI in my cordova project. I get the following error; D:\Projects\test cordova>cordova plugin add org.apache.cordova.network-information Fetching plugin "org.apache.cordova.network-information" via...

Start a process in background, do a task, then kill the process in the background

bash,command-line-interface
I have a script that looks like this: pushd . nohup java -jar test/selenium-server.jar > /dev/null 2>&1 & cd web/code/protected/tests/ phpunit functional/ popd The selenium servers needs to be running for the tests, however after the phpunit command finishes I'd like to kill the selenium-server that was running. How can...

How to use the --verbose flag in the MySQL 5.6 command line client?

mysql,command-line-interface
Going by the list of flags here, with the line at the top about usage: Usage: mysql [OPTIONS] [database]. I am running Windows 8; my table is "contact"; I want to create a tee file for source C:/myfile.sql with the verbose option on. I have tried mysql -v contact, -v...

How can I read iso-8859-1 file

linux,centos,command-line-interface
I try to read File.java file with iso-8859-1 encoding . I executed command like this iconv -f ISO-8859-1 FileSorter.java -t ASCII//TRANSLIT but I still get some wrong characters after converting: /** * Yoio iaoia auiieiyao ni?oe?iaeo nienea oaeeia * @param fileList iaioni?oe?iaaiiue nienie oaeeia * @return ioni?oe?iaaiiue nienie oaeeia */...

improperly importing sql file in postgres cli

database,postgresql,command-line-interface
I have a question about importing a sql file to postgres CLI. I may have been improperly importing my file or either I may have some User or Database privilege?!? issue. Anyways, these are just my hunches. I am trying to pinpoint the cause of this message after importing a...

Asterisk CLI - reset scrollback

command-line-interface,asterisk,elastix
in an Asterisk CLI, is it possible when scrolling back to have the cursor not to jump back when new output hit the CLI and only revert after a key is pushed or after scrolling back to the bottom? Alternatively, is it possible to limit the CLI output to a...

Translate ImageMagick CLI to PHP Imagick API

php,api,imagemagick,command-line-interface,imagick
I have problem with translating ImageMagick CLI command to Imagick PHP API. I looked at threads about it on Stackoverflow but people there used other commands... > convert color-to-add.png test.png -compose CopyOpacity mask-with-alpha.png > composite -compose multiply test.png mask-with-alpha.png compose-result.png I can't use exec method. I still try do do...

How to display progress of another command

bash,shell,command-line-interface
I need help with a bash script I run like this: do_something > file.txt (I'm using the third line of this file.txt in another echo output) Now I need to get a number of characters on the second line of the file.txt. (There are only dots - ".") I can...

docopt.go weird error message

go,command-line-interface,docopt
using docopt.go to refactor an old project and minimalise code the program looks like this package main import ( "fmt" "github.com/docopt/docopt.go" ) const Version = `2.0` const Usage = ` Usage: serve [--port] <dir> serve help | --help serve --version Options: -p, --port port for the sever to listen on...

Generate random BMP in CLI

image,random,command-line-interface
I need a truly random BMP in order to test various lossy image compression algorithms. Ideally, this would not rely on any library and run in a Linux CLI. It should generate a random BMP given a certain width and height....

Building C# code in VSCode on Mac

c#,osx,xamarin,command-line-interface,vscode
I've been building a command line tool using Xamarin. After being told about Visual Studio Code, I wanted to see if I could try using it as an editor and debugger. I managed to get it to debug an existing .exe file built with Xamarin, by editing the launch.json file,...

Erro Install Android Target - Cordova CLI

android,osx,cordova,command-line-interface
i am using Android SDK Studio with Command CLI of Cordova in my Mac Yosemite for developer a app, but i found that error para add platform android in my project. Command executing: cordova platform add android Error: /Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:126 throw e; ^ Error: Please install Android target "android-19". Hint: Run...

Google Cloud SQL - ERROR 2003 (HY000): Can't connect to MySQL

mysql,google-app-engine,command-line-interface,ip-address,google-cloud-sql
I am trying to connect my Google Cloud SQL using the command line. I can successfully connect when at home and I set a static IP address. However, I have to be on the road the next few days and I can't be at home. I am hoping to connect...

How can I pass the result of a command to another command in one line?

bash,shell,command-line,concatenation,command-line-interface
How can I pass minutes since midnight to a cli in one line? This works: echo $[ ( ( `date "+%s"` - 28800 ) % 86400 ) / 60 ] // Correctly returns minutes since midnight in PST But how can I pass the same into another command? This doesn't...

Creating BAT File for Cisco CLI commands (left string/concatentate into output)

windows,batch-file,command-line-interface,cisco
I think I've looked sufficiently for this, but I haven't come up with much. Or rather I think I've found pieces, but I am not strong enough in scripting/BAT/Programming to make it all come together. I have an idea for how this should go, but I think I may be...

Getting error while installing phone gap in MAC osx?

ios,osx,cordova,phonegap-plugins,command-line-interface
I'm trying on install Phonegap in my MAC os(10.10), i have xcode 6.1.1 installed in my system. I'm following this and this link to install phonegap and installed Node.js and Command-Line Interface (CLI), but when i try to run this command npm install -g phonegap, i got error like shown...

Terminating python for loop program in the command line without closing it?

python,command-line-interface
When I open python 2.7.9 in the command terminal in Windows 8 and I run this program: while True: for i in ["/","-","|","\\","|"]: print "%s\r" % i, How can I terminate this program without closing the command terminal? I apologize in advance if this is a novice question but I'm...

Apache Commons CLI(Options)

java,command-line-interface,options
I have been learning how to use Apache commons CLI. I want to use the options class to describe the possible options for a command-line, but I have seen in some tutorials that they use two ways to add a new option. The first is this: options.addOption( OptionBuilder.withLongOpt( "block-size" )...

Weird behaviour of cURL request in PHP script

php,apache,curl,browser,command-line-interface
I'm experiencing weird behaviour of a cURL request that I do in my PHP code. I'm running the code locally on a standard WAMP Apache server. Here's the code: $auth_info = "..."; $some_url = "..."; $channel = curl_init(); curl_setopt($channel, CURLOPT_URL, $some_url); curl_setopt($channel, CURLOPT_HTTPHEADER, array("Authorization: BASIC " . base64_encode($auth_info)) ); curl_setopt($channel,...

Merge 2 files using command line tools

csv,awk,sed,command-line-interface
I am 2 csv files looking like this: id, name, job 1, bob, fireman 3, alice, nurse 7, peter, policeman ... And: id, name, age 2, john, 26 4, craig, 32 5, mary, 45 6, lucy, 23 ... As you can see, they are both sorted by ids and the...

how do i take unlimited sys.argv[] arguments?

python,parsing,python-2.7,command-line-interface,argv
To elaborate, I am interested in learning how to code out in python a sys.argv[] function that allows the user to supply as many arguments as the user wants. I am unsure on if there is a better way to do this or if it can be done at all....

How to use aws cli --generate-cli-skeleton

amazon-web-services,command-line-interface,aws-cli
I have seen the option --generate-cli-skeleton in a lot of aws CLI docs, however every time I add it to a aws cmd I get Unknown options: --generate-cli-skeleton. Can someone tell me or point me to instructions on how to use this option thanks Art...

php shell_exec character allowed and limit - JSON encoded string as parameter

php,json,command-line-interface,shell-exec
I'm trying to pass a JSON encoded string in php shell_exec function but it seems like it doesn't accept whole string. My code: $exec_string = json_encode( $data ); $command = "php index.php exec_function " . $exec_string; $output = shell_exec( $command );` echo "<pre>$output</pre>; My index.php public function exec_function ( $data...

how to impement utility feature in a command line tool [closed]

java,command-line-interface,utility
i have developed a commandline tool by name translator in java and i run this tool by creating a jar file and using below command java -jar translator.jar < input1 > now i have been asked to add a usage/ utility feature to this tool, like example how when we...

how to use .include? in Ruby with a hash statement

ruby,command-line-interface
How do I get the .include? to work? When the user chooses a character, I want the console to print the puts ok statement and then go to the if statement. name = {"1" => "Mario", "2" => "Luigi", "3" => "Kirby", } puts "Peach's apocalypse, will you survive?" def...

Node bin file not being recognized on linux or osx

node.js,command-line-interface
I've been developing a node cli app using PyCharm from Windows and it works only on Windows, but always returns : No such file or directory when being run from Linux. I've been able to reproduce the issue using a fairly basic example as a test. Try installing each version...

Shell function command with quotes

bash,shell,command-line-interface,zsh
I am trying to make a git shortcut to commit with a message. Since aliases do not support parameters I came up with this function: function gcm() { git commit -m "$@" } My expectation is to commit with a message without even typing quotes like this: gcm create cli...

Create a Black Jack game with a command line Interface

java,command-line-interface,blackjack
I have an assignment in my Java 1 class. It is to create a Black-Jack Game with a Command Line Interface. However my book only has one page devoted to Command-Line Arguments. This project is an extra credit thing so I guess we are supposed to look elsewhere to find...

Debugging Node.JS CLI application with VSCode?

node.js,debugging,command-line-interface,xubuntu,vscode
playing around with the newly released VSCode Editor/IDE. I wanted to try out debugging on a very basic Node.JS CLI application, which uses the "prompt" npm package: prompt.start(); prompt.get(schema, function (err, result) { ... When I set some breakpoints and start the app debugging, VSCode just steps over the prompt.get()...

Convert videos with all contained subtitles and audio into mp4 via commandline using handbrake

audio,video,command-line-interface,subtitle,handbrake
I'd like to convert my videos with Handbrake from mkv to mp4. But I want all audio files and subtitles contained in the mkv into the new mp4 container! I use Handbrake 0.9.9 GUI because in this version you can predefine the amount of audio tracks and subtitles per default...

Script to copy and rename file fails on Mac OS X

osx,bash,command-line-interface,provisioning-profile
I followed this question: Provide xcodebuild with .mobileprovision file and used the script provided in the answer to try and copy .mobileprovision files into the directory, the only difference is I replaced the mParse dependency using grep, as per a suggestion in this link: https://gist.github.com/benvium/2568707 However, when I run this...

Deleting a file through cli in vagrant give permission denied

php,vagrant,command-line-interface
I'm trying to run a php script from the command line in vagrant, but I'm getting a permission denied error when trying to delete a file. Using the command sudo chmod 777 messages/ does not work, because I can't change the directory permissions, vagrant's shared folders don't allow that. I...

Space is appearing in https url in linux

linux,shell,curl,command-line-interface,centos6
I am writing a .sh file in centos. In script, am writing curl commamd as curl -u admin:final https://$nodeip:8089/services/cluster/config/config But in CLI it s passing as curl -u admin:final https:// MYHOST:8089/services/cluster/config/config nodeip i.e. MYHOST value, am fetching from database and passing it into url in same script. as nodeip=`cat $root/dbtmpdn...

How can I run grunt as a daemon?

node.js,gruntjs,command-line-interface,daemon,epub
I am running a packaged nodejs webserver that allows for reading of epub files (Readium-JS), and it is started with the grunt command. However, if I run this on my VPS the server dies as soon as my terminal connection ends. How can I run this task as a daemon?...

C# - Converting String array to sbyte** (String[] to sbyte**)

c#,arrays,pointers,clr,command-line-interface
XFunction is a CLI to managed C++ code (wrapper). I want to use XFunction(int,sbyte**) in my C# Project and convert String array to sbyte**. sbyte[][] sbytes = new sbyte[7][]; for (int argCounter = 0; argCounter < 7 ; argCounter++) { //get the byte array byte[] bytes = Encoding.ASCII.GetBytes(argument[argCounter]); //convert it...