Questions tagged [command]

A command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell. Use [command-pattern] for the design pattern.

A command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell.

Specifically, the term command is used in imperative computer languages. These languages are called this, because statements in these languages are usually written in a manner similar to the imperative mood used in many natural languages. If one views a statement in an imperative language as being like a sentence in a natural language, then a command is generally like a verb in such a language.

Many programs allow specially formatted arguments, known as flags, which modify the default behaviour of the command, while further arguments describe what the command acts on. Comparing to a natural language: the flags are adverbs, whilst the other arguments are objects.

More links:

10688 questions
3
votes
1 answer

FFMPEG Command in Android Failing to Execute

I'm trying to execute ffmpeg commands through an android app I'm developing. I found this post which has been somewhat useful: Problems with ffmpeg command line on android and I downloaded a static build of ffmpeg from here:…
Zoe
  • 33
  • 4
3
votes
1 answer

command design pattern usage

I've read 3 descriptions of the command design pattern: wikipedia, dofactory and source making. In all of them, the UML shows a relation between the client to the receiver & the concrete command, but no relation to the invoker. But in all 3 examples…
sagie
  • 2,998
  • 3
  • 22
  • 31
3
votes
1 answer

Sublime Text 3 - Custom Command - Adding Text to element

I'd like to create a custom keybinding on ST3 so that whenever I highlight an element or my cursos is next to it, it surrounds it with a predefined text. Something that would look like that { "keys": ["ctrl+shift+m"], "command":…
Jean Henry
  • 436
  • 4
  • 14
3
votes
3 answers

How to define new commands or macros in awk

I like to define a new command that wraps an existing awk command, such as print. However, I do not want to use a function: #wrap command with function function warn(text) { print text > "/dev/stderr" } NR%1e6 == 0 { warn("processed rows:…
Juve
  • 10,584
  • 14
  • 63
  • 90
3
votes
1 answer

Run console command in ruby, get PID of child process and kill it in some seconds

I need to run console command in ruby (in my case to start Gvim), get PID of Gvim and kill that process in a few seconds. If I do the following - it gives me PID of parent process, but I need somehow to find out the PID of Gvim. IO.popen("gvim…
kovpack
  • 4,905
  • 8
  • 38
  • 55
3
votes
1 answer

how to execute sudo command with ant sshexec

i'm trying to execute a command in a remote server with sudo like this
Enrique San Martín
  • 2,202
  • 7
  • 30
  • 51
3
votes
1 answer

How to fire up 'clicked' event after 'command' event of a button click in XAML?

I am having a button with two events, i.e. 'command' and 'clicked'. But while executing, my 'clicked' event gets fired up followed by 'command' event. I want it in a reverse order. Is there a way to fire up 'command' event first? Any help would be…
Ali_Waris
  • 1,944
  • 2
  • 28
  • 46
3
votes
2 answers

create batch file to copy folder contents with dynamic name

I am absolutely brand new to any kind of development but need a batch job to copy a file from one folder to another. The problem is that the source folder is dynamically named. The folder name will contain the current date and a suffix number (eg.…
jamieleesis
  • 41
  • 1
  • 3
3
votes
1 answer

Command String parsing tools for NodeJS

I am using SailsJS for an application. From front-end i.e. NodeWebkituser will be entering a command which will be sent to server via sockets. This command is parsed in back-end and a specific service/controller is called. Socket code is as…
Abhishek
  • 1,999
  • 5
  • 26
  • 52
3
votes
1 answer

Mdfind exclude a folder

-onlyin option in mdfind searches a particular folder. How do I exclude certain folders in combination with -onlyin? Thus if I want to search the entire folder SearchHere containing folders A , B and C and exclude from searching within C.
pal4life
  • 3,210
  • 5
  • 36
  • 57
3
votes
1 answer

How to run a custom command on visually selected text

In my .vimrc I have the following command declared: :command EscapeUnderscore %s/_/\\_/g However, I want to be able to visually select a few lines and have the command only affect the selected lines. Currently I get the error E481: No range…
Alex Luecke
  • 197
  • 2
  • 9
3
votes
1 answer

Perl Script to Get Python's Version

Is there an easy way to get the version of python from a perl script. E.g. Get the equivalent of the version python -V. I need this to determine if I need to run python26 or just python on some of my linux boxes. If there isn't an easy way, I plan…
James Oravec
  • 19,579
  • 27
  • 94
  • 160
3
votes
2 answers

Set up java environment variable value using bat command permanently

I write a bat script to set java path in envirnment variable. I use following command to set path - setx PATH=%jdkDirDest%\bin;%PATH%. setx PATH=%playDirDest%;%PATH%. set PATH=%jdkDirDest%\bin;%PATH%. set PATH=%playDirDest%;%PATH%. It works fine…
Anupam Sharma
  • 1,529
  • 1
  • 14
  • 33
3
votes
2 answers

WPF relaycommand from usercontrol

I'm new to WPF and in the spirit of trying to do things the correct way have tried to implement MVVM in my application. I've made use of the frequently mentioned article by Josh Smith, and apart from making me realise how little I know, it has left…
pilsdumps
  • 495
  • 1
  • 7
  • 23
3
votes
2 answers

Installing an APK using pm command

I tried updating an APK using this code: Process process; process = Runtime.getRuntime().exec(new String[] {"su", "-c", "pm install -r -d"+MyApk.apk}); but it does not work. This works well when I use it with adb like: adb shell su -c pm install -r…
Sbonelo
  • 664
  • 1
  • 9
  • 25