command

Powershell: Pipe external command output to another external command

被刻印的时光 ゝ 提交于 2019-12-07 17:32:21
问题 How can I get PowerShell to understand this type of thing: Robocopy.exe | Find.exe "Started" The old command processor gave a result, but I'm confused about how to do this in PowerShell: &robocopy | find.exe "Started" #error &robocopy | find.exe @("Started") #error &robocopy @("|", "find.exe","Started") #error &robocopy | &find @("Started") #error &(robocopy | find "Started") #error Essentially I want to pipe the output of one external command into another external command. In reality I'll be

Split file by XML tag

若如初见. 提交于 2019-12-07 15:14:24
I have a very large xml file (1.25 GB) that I need to split into smaller files to be able to process them. The file contains linguistic data that is headed and footed by the tags: < text id="www.example.com> and < /text> I would like to split the larger file by these tags. So that, for example, < text id="www.example.com> Hello < /text> < text id="www.example.com> This is < /text> < text id="www.example.com> An Example < /text> Would essentially be three different files: with the beginning and end marked by the "text" tags. For example: File 1 < text id="www.example.com> Hello < /text> File 2

Running a shell command to copy files from Android App

大城市里の小女人 提交于 2019-12-07 12:44:44
问题 i'm trying to get an app started so I can backup my apps to sdcard. I ran: Process p = Runtime.getRuntime().exec("su"); Process c = Runtime.getRuntime().exec( "cp /data/app/com.ebay.mobile-1.apk" + Environment.getExternalStorageDirectory() + "/ebay.apk"); Log.d("copy", "done"); When it runs I can grant super user then it says it's done but there is no file is not copied. I'm just using the eBay app as an example and test. Thanks for any help. Fix: thanks for the help below but i found a full

How to bake cakephp 2.0 application on windows with wamp

我们两清 提交于 2019-12-07 11:10:41
问题 I want to bake cake php project on Windows system. I'm using wamp server for PHP mysql. I've gone through the video casting on the cakephp site. And did set up the environment setup. After giving command "cake" as per the demo,Finally I got a message saying 'php' is not recognized as internal or external command. operable program or batch file. Please help me in baking cake php 2.0 project in Windows system. 回答1: You need to put the path to the php.exe into your system variables. Right-click

Binding two commands in one button WPF/MVVM

南楼画角 提交于 2019-12-07 08:56:50
问题 I have a tab control contains two tabs, one shows me the messages of a running process and the other shows me a web page! I have three buttons (start, stop and clear) when I press start the process run and the messages show up. What I need is wen I press Start button, both tabs, shows me the required content. That's mean I need two bind two commands to the same button Do you know how to bind for 1 button two commands? I'm using MVVM, and I'm new in MVVM. <Button Content="Start" Command="

Why do du and Perl's -s give different values for the file size?

☆樱花仙子☆ 提交于 2019-12-07 08:20:27
问题 Updated According to comments: I have outlog.txt file which contains multiple filenames, e.g: 2345_535_Dell&HP_3PAR_DEAL.txt , similarly there are many filename but not the actual folder where the files are located and so in code am appending filenames to folderpath to get actual file location. Now,I want to get disk usage of all the files present in outlog.txt and also total disk usage of all files present in outlog.txt . I have tried two approaches perl -s and my ($size) = split(' ', du `"

Xamarin.Forms Long Press Effect - How to set the Command in Code Behind (NO XAML)

烂漫一生 提交于 2019-12-07 07:14:23
I'm using this solution for handling the long tap event: https://alexdunn.org/2017/12/27/xamarin-tip-xamarin-forms-long-press-effect/ It works fine when I use XAML, but I need to use code behind only. How can I add this command to the Image in the code behind? Here is the code that creates my image: var image = new Image { ClassId = item.Path, Aspect = Aspect.AspectFill, Source = item.ThumbNailImage, Rotation = 90, Margin = 10, GestureRecognizers = { _tgr }, //Command here, but how? }; This documentation on Microsoft's website is very helpful in explaining how to set attached properties in

Commands in MVVM

天大地大妈咪最大 提交于 2019-12-07 06:43:11
问题 I've been seeing tutorials where people are creating the methods like CanExecute in their code. I'm assuming they are doing this to help the reader understand how it all works. When I look up Command and ICommand it takes me to the ICommand class on MSDN that is used for Windows Store apps. Is there not a Command class for WPF? 回答1: The built-in implementation of ICommand in WPF is RoutedCommand (and its sibling RoutedUICommand ). RoutedCommand works like this: The Execute and CanExecute

how to call shell commands from groovy correctly

只谈情不闲聊 提交于 2019-12-07 06:42:42
问题 i want to execute shell commands from my groovy script. I tested the following: "mkdir testdir".execute() and this just works fine. Now i wanted to make a file, write something to the file and then open a text editor to view the file. def execute(cmd) { def proc = cmd.execute() proc.waitFor() } execute("touch file") execute("echo hello > file") execute("gedit file") Now gedit opens correctly but ther is no "hello" string in the file. How is this working?!? 回答1: You cannot do redirection in

Executable Deleting Itself on linux [closed]

心已入冬 提交于 2019-12-07 06:08:55
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Being a super user , I executed the following command on linux rm rm which removes itself. Because when process is in execution , its reference count is not zero.Hence it cannot be deleted. So I am bemused, how and why does it happen? I tried the same with chown 0000 chown as well. cp -r Dir1/ Dir2/ In above