command

What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim?

北慕城南 提交于 2019-12-17 02:51:41
问题 What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim? 回答1: remap is an option that makes mappings work recursively. By default it is on and I'd recommend you leave it that way. The rest are mapping commands , described below: :map and :noremap are recursive and non-recursive versions of the various mapping commands. What that means is that if you do: :map j gg :map Q j :noremap W j j will be mapped to gg . Q will also be mapped to gg , because j

Running command with with space argument value with apache command line

无人久伴 提交于 2019-12-14 03:44:09
问题 I'm using apache command line library and I want to execute from java program git stash list --format=%gd:%at:%B --grep="some text with space" this is the code commandLine.addArgument( "--grep=\"" + filter+"\"", false); it is run on windows without any problem but on linux does not. If i execute the command from terminal it is execute correctly I also tried to let apache library to put quoting commandLine.addArgument( "--grep=" + filter); but i get fatal: bad revision '"--grep=text message"'

create a dameon of a script that checks if httpd service is on or off [duplicate]

拟墨画扇 提交于 2019-12-14 03:38:04
问题 This question already has an answer here : Run current bash script in background (1 answer) UNIX script to check if httpd service is on or off and if off send a email [duplicate] Closed 3 years ago . Script to check if httpd is on or off #!/bin/bash service=service_name email=user@domain.com host=`hostname -f` if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) then echo "$service is running" else /etc/init.d/$service start if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0

find command to rename files

淺唱寂寞╮ 提交于 2019-12-14 03:25:41
问题 I have created a list of files with names in uppercase alphabets and trying to rename them to files with the same names but in lowercase alphabets. So if i have 20 files with filenames like FILE1, FILE2, FILE3, etc. I want to rename them to file1, file2, file3, etc. respectively. I am executing the below command [root@host-1-1 files]# find . -name 'FILE*' -exec mv {} `echo {} | tr [:upper:] [:lower:]` \; But i am receiving below errors from mv command. Could someone please tell me what i am

Java: Redirecting output of .bat file in other text file using exec() method?

只愿长相守 提交于 2019-12-14 02:20:23
问题 Java is new to me. I am executing a batch file using Runtime.getRuntime.exec(filename.bat) and this batch file executes a command ant encrypt.password -Dvalue=somevalue>log.txt and redirects its output to a log.txt file. Problem that I am facing is batch file is working fine if I run it manually however when program executes it ,it just creates blank 'log.txt' Content of mybat.bat batch file is as below: cd/ c: cd c:/ant_builds/thinclient ant encrypt.password -Dvalue=someValue >C:/log.txt

Command not works in subprocess or os.popen but works in terminal

蹲街弑〆低调 提交于 2019-12-13 20:09:20
问题 I've tried lots of methods to run my shell script but none of these works from python3 script. The command is very simple and works in terminal without problem. Here's what I've tried without sucsess: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os dat = os.popen('sh commonBash.sh').read() print(dat) if "no" in dat: print('Not found') status = 'Install' else: print('Found') status = 'Remove' When I run in terminal the output is correct and working, but when I try to run in python

How do I bind a command to e.g. the right mouse button in a ControlTemplate in WPF?

巧了我就是萌 提交于 2019-12-13 19:24:00
问题 I have a custom Control derived class and a view model to go with. The user can do several actions with this control, and I'm thinking it's best to implement these as RoutedCommand objects or ICommand derived objects in the view model so the ControlTemplates can bind to them. Binding a command to a button in one ControlTemplate should be straightforward, but how can I bind the command to e.g. the right mouse button in another ControlTemplate? Probably a MouseGesture is involved, but I'm

How do I save a ruby file? (error)

余生长醉 提交于 2019-12-13 19:17:23
问题 I am receiving the error No such file or directory in my command line and I think it's because I am not saving the ruby files somewhere specific. All I did was create a random folder where I would save my ruby files. Do I need to save my scripts in the original ruby folder? Thanks! ** This is Windows 7. More info - All I did was make a simple file named "Matz.rb" because I'm currently reading the O'reilly Ruby book. In my code all I wrote was puts "Hello Matz". I saved this on my desktop.

Executing bash command and getting the output in C

只愿长相守 提交于 2019-12-13 18:43:31
问题 Hello I have seen some solutions on the internet, all of them are basically creating a file, however I want to store them in an array of char. Speed is really important for me and I don't want to spend any time for working on hard drive. So popen() is not a real solution for me. 回答1: Here is a working code snippet: char bash_cmd[256] = "ls -l": char buffer[1000]; FILE *pipe; int len; pipe = popen(bash_cmd, "r"); if (NULL == pipe) { perror("pipe"); exit(1); } fgets(buffer, sizeof(buffer), pipe

Function not going to next steps

一世执手 提交于 2019-12-13 17:57:21
问题 I have created below function, when I am executing this function with shell script it completed fine but not going to next steps time_check() { . /u01/scripts/${1}.env export create_env_log=${logs}/create_env_log_${dts}.log echo 'STime:' date +%s > ${create_env_log} "$@" echo 'ETime:' date +%s >> ${create_env_log} export st_time= grep -i STime ${create_env_log} |cut -d':' -f2 export en_time= grep -i ETime ${create_env_log} |cut -d':' -f2 export exectime=$((en_time-st_time)) echo 'Completed in