I noticed that the Python 2.7 documentation includes yet another command-line parsing module. In addition to getopt and optparse we now have argparse.
Why has yet another command-line parsing module been created? Why should I use it instead of optparse? Are their new features I should know about?
...
I'm new to using Perl to call the linux command line and have looked through a number of tutorials but still can't figure out what I am doing wrong.. I am trying the code below (in a .pl perl file, as an executable):
#!/usr/bin/perl
perl -e 'print "Hello";'
I run this script and get: "Execution of /home/user1/Desktop/file_backups.pl...
I'm wondering if there is a way to change a specific word in all of the files within the /www/ directory using command line. Just looking for a faster way to change out a specific word so I don't need to open all the files manually! Thanks!
...
I have a directory of files like so:
parent
/dir1
file1
file2
other
something
name_pattern.o23409284
name_pattern.o29203429
name_pattern.o39208235
/dir2
...
I want to run a command that will look in the newest name_pattern.o* file for a line beginning with:
***END
...
Hey guys,
I have a simple question. Is there a command that allows you to pull a certain line out of an input? Like if I wanted the 7th line from ifconfig. Is there a way to do this: ifconfig | [command] 7?
Thanks!
...
I have a simple cmd.php page to run commands I enter using shell_exec () and show the output.
PHP is running as CGI
Entering "php -v" and most commands just show "Content-type: text/html" and then the current page's HTML source.
However, calling PHP with an invalid parameter (/usr/bin/php -z) shows PHPs usage:
Usage: php [-q] [-h] [-s...
Hi,
Can someone help me with chaining commands to use ls to recursively list all files modified in last 24 hours?
Thank you!!!!
JG
...
On my OS X command line, I would like to find all files ending in .per that are missing the string 'connection_id'.
How do I go about doing this. Finding the files that have a given string is easy but am not sure how to do this if the string is missing.
Thanks!
...
I would like to be able to parse command line arguments in my python 2.6 program.
Ideally, I want to be able to handle these cases:
# show some help
./myprogram --help
# these are equivilent
./myprogram --block=1
./myprogram -b 1
# this means verbose, and twice as verbose:
./myprogram -v
./myprogram -vv
...
Hey all,
So I found a great little EXE command line app (we'll call it program.exe) that outputs some data I would like to manipulate with C#.
I was wondering if there was a way to "package" program.exe into my visual studio project file, so that I could hand my compiled application to a co-worker without having to send them program.ex...
Hi
In linux, we can do it with tr command to remove space.
How can I do it in windows?
I like to remove space in each line of a text file from command line in Windows XP.
Thanks.
...
I am trying to look at the method members of a class within a jar file. Currently to list all the classes within a jar file, one can call this command:
jar -tf myjar.jar but if i want to list the public methods within a particular class in this jar file, How do i go about it. Thanks
...
This one should be an easy one.
An example would be the following:
The user clicks a button titled "Ping" and it uses the command prompt "ping" to ping the server. The output is captured in a string and displayed in the windows forms app to the user.
...
I've been looking around but can't figure this out.. I figured out how to do a perl execution of a shell script, such as:
#!/usr/bin/perl
$cmd = "nautilus";
system $cmd;
However, I want to do a shell script execution from perl that would do something like this on the command line:
su
$password
nautilus
So it would become root, then...
I'm in a situation where I need to parse arguments from a string in the same way that they would be parsed if provided on the command-line to a Java/Clojure application.
For example, I need to turn "foo \"bar baz\" 'fooy barish' foo" into ("foo" "bar baz" "fooy barish" "foo").
I'm curious if there is a way to use the parser that Java o...
I have a situation where we are releasing a new version of our application, and I was wondering how other people handle the situation where they have a datafile and opening/editing that file.
In the previous version of the application users could make a backup file which contains all the necessary parts of the system to transport and re...
Hi,
I have a .jar file which has a command line interface. I want to call the jar file through command prompt and capture the output of the Jar file.
I have tried with the exec() command.
The command I have used is:
<?php
exec('java -jar D:\\Development\\Filehandler\\dist\\Filehandler.jar \ getConfigLang', $result);
echo $result;
echo...
I have the following command:
java -jar ...\ivy-2.2.0-rc1.jar -ivy ...\ivy.xml
Which I am expecting to resolve the dependencies and copy them to the lib folder of my project.
Ivy seems to resolve the dependencies but does not do the copy. If I run the ant task the copy happens correctly.
Does anyone know why the copy to lib does no...
Is there anyway to install the msi at specific location through the command line.
...
Hello,
In my Qt GUI application, I am calling the command prompt through:
system("lots.exe & of.exe && commands.exe");
It opens up the command prompt (like I want it to), but freezes the Qt GUI application until I close the command prompt. Is there someway to prevent this? I saw that there is a QProcess class, but can't get it to br...