command

Redirect java -version to file or variable

≯℡__Kan透↙ 提交于 2019-12-01 16:05:17
问题 Maybe it is a silly question, but I'm trying to redirect the exit of "java -version" command to a file or variable but it doesn't work. Server = Linux CentOS 6 My code in shell script java -version >> test.txt Also I'm trying to assign it to a variable: JAVA_CHECK=`java -version` Even running those command from command-line it still not working. when I say it doesnt work, I mean that the exit of the command is being showed in my screen instead to redirect it to a file or wherever ... 回答1:

Is there a keyboard shortkey to browse the history in a Jupyter notebook

孤者浪人 提交于 2019-12-01 15:59:00
Is there an easy way to browse through command history and reuse old commands in a Jupyter notebook? Some equivalent to either the arrow up/down use in the iPython console or to the % sign use in Mathematica. (Although the answer might seem trivial to an expert, it is really hard to find for a newbie) I was looking for the same. But a year later, and after about 10 min of scouring the best I found ( link ) is this magic command: %recall last or %recall <integer> , which after execution copies a command from history into a new cell. Probably not quite what you had been looking - a tad too

Run command after 1 hour in Linux

☆樱花仙子☆ 提交于 2019-12-01 15:37:45
I just want to echo my string after 1 hour . I saw at command but it can run script at specific time ( HH:MM ). I want my echo command to run after 1 hour whatever the time it is. It is sleep 60m && ls You can also use at (at is very good at understanding times, see this page for a lot of good examples). > at now + 1 hour at> echo 'my string' > /dev/stdout at> ^D After you input the at time specification it will take you to the at prompt (your OS my or my not show the at> prompt, OSX doesn't for example). You then type whatever commands you want executed and press Control-D to exit the at

Multiple Key Event Bindings in Tkinter - “Control + E” “Command (apple) + E” etc

假装没事ソ 提交于 2019-12-01 15:33:00
问题 Mac OS X 10.6.6 - Tkinter I want to bind multiple-key events, and while I have found an effbot article and the Tk man pages, I've been unable to make this work correctly. I'm new here. I've had mixed success. I've been able to get Shift + letter key, but not Control or Command (Apple key). What I really want to do is Command + letter and Control + letter key so it would theoretically work in Windows and OS X. I want it to work at window-level, so I'm using root. Perhaps there is a better way.

Execute a colorized command from a php script

烈酒焚心 提交于 2019-12-01 15:26:23
I have a command, for example 'git diff' that output a colorized result when I run it from the terminal. Now, I want to call that command from a CLI php script and display in the console the colorized result. I have try with exec(), system(), passthru() but in all case the output has been converted to plain black and white text. Is there a way to preserve the color of the standard result? If not, does someone know why this information get lost? In all likelihood the command you are running is checking to see if output is to a terminal and not colorizing it if it isn't. There is usually a way

Run command after 1 hour in Linux

£可爱£侵袭症+ 提交于 2019-12-01 15:12:50
问题 I just want to echo my string after 1 hour . I saw at command but it can run script at specific time ( HH:MM ). I want my echo command to run after 1 hour whatever the time it is. 回答1: It is sleep 60m && ls 回答2: You can also use at (at is very good at understanding times, see this page for a lot of good examples). > at now + 1 hour at> echo 'my string' > /dev/stdout at> ^D After you input the at time specification it will take you to the at prompt (your OS my or my not show the at> prompt,

How to run a shell command through vimscript?

独自空忆成欢 提交于 2019-12-01 15:03:38
问题 In my Vim setup I'd like to add a configuration that runs a shell command with a certain mapping. Is there any possible way to do this in Vimscript? 回答1: There is a system() function in vim ,try this: :call system('date') 回答2: I do this with traditional vi, so I assume it would work with vim as well. In my .exrc I have: map ^_ !}fmt 71 72^M (That's a ^_ entered by typing ctrl-V ctrl-_ , and a ^M entered by typing ctrl-V ctrl-M When I hit ctrl-_ in vi, it reformats my current line to 72

Is there a keyboard shortkey to browse the history in a Jupyter notebook

跟風遠走 提交于 2019-12-01 14:58:53
问题 Is there an easy way to browse through command history and reuse old commands in a Jupyter notebook? Some equivalent to either the arrow up/down use in the iPython console or to the % sign use in Mathematica. (Although the answer might seem trivial to an expert, it is really hard to find for a newbie) 回答1: I was looking for the same. But a year later, and after about 10 min of scouring the best I found (link) is this magic command: %recall last or %recall <integer> , which after execution

how to show proccess like in ps -e

大憨熊 提交于 2019-12-01 14:52:38
Hello! I wanto to make simple c proggram what will work like ps -e. The only colums that should be shown are PID and CMD. Thats my code: #include <dirent.h> #include <errno.h> #include <sys/types.h> #include <stdio.h> #include <regex.h> int main() { DIR *dir; struct dirent *entry; if ((dir = opendir("/proc")) == NULL) perror("operation error"); else { printf("PID CMD\n"); while ((entry = readdir(dir)) != NULL) printf(" %s\n", entry->d_name); closedir(dir); } return 0; } My questins are: 1) How i can show only folders with numbers(i don't know how to implement regcomp())? 2)How to near PID

how to show proccess like in ps -e

坚强是说给别人听的谎言 提交于 2019-12-01 14:27:58
问题 Hello! I wanto to make simple c proggram what will work like ps -e. The only colums that should be shown are PID and CMD. Thats my code: #include <dirent.h> #include <errno.h> #include <sys/types.h> #include <stdio.h> #include <regex.h> int main() { DIR *dir; struct dirent *entry; if ((dir = opendir("/proc")) == NULL) perror("operation error"); else { printf("PID CMD\n"); while ((entry = readdir(dir)) != NULL) printf(" %s\n", entry->d_name); closedir(dir); } return 0; } My questins are: 1)