I've created a basic menu class that looks like this:
class Menu:
def __init__(self, title, body):
self.title = title
self.body = body
def display(self):
#print the menu to the screen
What I want to do is format the title and the body so they fit inside premade boxes almost. Where no matter what I pass...
I need to pass the content of the textbox into a variable. i.e. whatever typed in the texbox of the html page needs to be pass to a variable. This is because I am calling HTML (CGI as well) inside linux shell programming. I need to manipulate that variable as I want. Do you have any idea to do it?
What I need to do is, I want to get the...
Hi,
I encountered some problems with the shell function in php. I want to execute a java program on the server by running a php function on a php webpage.
The java program writes some chars to a local file on the server.
test.php
<?php
$WshShell = new COM("WScript.Shell");
$cmd = ' "C:\\Program Files\\Java\\jdk1.6.0_14\\bin\\...
Using OS X, I need a one line bash script to look at a client mac hostname like:
12345-BA-PreSchool-LT.local
Where the first 5 digits are an asset serial number, and the hyphens separate a business unit code from a department name followed by something like 'LT' to denote a laptop.
I guess I need to echo the hostname and use a combinat...
Hello,
I'd like know how to do a plain substring match in a shell script.
For example, if I have
STRING1="http://127.0.0.1/"
STRING2="http://127101011/"
SUBSTRING="127.0.0.1"
I want SUBSTRING to match STRING1 but not STRING2. It's like java.lang.String.indexOf(String).
I guess the problem can also be fixed by properly escaping th...
What will this command do?
exec 2>&1
...
Hi
I want to know how to add a new button in windows explorer. I don't want to create a new toolbar. I just want to add a new button in the same windows explorer standard buttons toolbar and not IE.
I appreciate any help possible.
Regards
...
I am editing someone else scripts and I see s/he has used this \c very often like
echo "bla bla \c"
which when used simply prints
bla bla \c
in screen.
So, I was wondering why use it or may be I am missing something, because it is doing nothing at all ? I checked escape characters and I didn't find any such thing as well. Is there...
I know this is simple but I just cant figure it out.
I have a bunch of files output by "svn st" that I want php to do a syntax check on the command line.
This outputs the list of files: svn st | awk '{print $2}'
And this checks a php script: php -l somefile.php
But this, or variants of, doesn't work: svn st | php -l '{print $2}'
Any...
I am trying to pass the 'day' from the while loop into a sql statement that then gets passed into a MySQL command line to be executed with -e
I can not use the DB module or other python libraries to access MySQL, it needs to be done via command line. It also looks like I might need to convert the day to a string before concatenating to...
I want to get the CPU and memory usage of a single process on Linux - I know the PID. Hopefully, I can get it every second and write it to a CSV using the 'watch' command. What command can I use to get this info from the Linux command-line?
...
Hello,
Find:
regexp1 **sometext** regexp2
Replace with:
newregexp1 **sometext** newregexp2
Here, I do not want **sometext** to be modified.
That is to say, if I have the following lines in a file:
Hello somebody! Have a good day.
Hello somebodyelse! Have a good day.
I want the output to be:
Bye somebody! Good night.
Bye so...
I want to execute a long running command in bash shell, and both capture its exit status, and tee its output.
So I do this
command | tee out.txt
ST=$?
The problem is that the variable ST captures the exit status of tee and not of command. How can I solve this?
Note that command is long running and redirecting the output to a file to...
What is the simplest way to parse line continuation characters? This seems like such a basic action that I'm surprised there's no basic command for doing this. 'while read' and 'while read -r' loops don't do what I want, and the easiest solution I've found is the sed solution below. Is there a way to do this with something basic like ...
Is it possible to have a block (as in "rectangular") selection in xterm?
If yes, is it assigned by default to a key/mouse binding or does it have to be assigned separately?
Thanks :)
Sorin
...
I'm aware that it's straightforward to redirect the shell output to a file.
So I should also be able to set up a socket and redirect the shell's output to the socket, as essentially it's just another file descriptor (I think)?
I've seen some example C programs that create some basic client/server functionality but (as small as they are...
As a new shell developer I came across many new articles that have links and
examples from a website called Shellrevealed.com
Unfortunately all of those links are dead as Shellrevealed itself can not
be found anywhere.
My question is, did they really shutdown or did they change their url????
...
I want to select a block of text (eg. V%) and use the text as input to a shell command (eg. wc or pbcopy) - but I DON'T want to alter the current buffer - I just want to see the output of the command (if any) the continue editting without any changes.
Typing V%!wc translates to :'<,'>!wc and switches the block of text for the output of ...
I am trying to run commands from ruby via system (or by using backticks), but am running into problems. When I try to call a command, the shell is unable to find it, even though I know it works if I call it straight. For example:
`zip`
>> sh: zip: command not found
The problem seems to be that ruby is using the sh shell, in which $PAT...
I am trying to get the last line of a file.
The file, ff.log, is getting new data every second while ffmpeg is working.
The log file looks like this:
frame= 20 fps= 0 q=7.7 size= 40kB time=1.24 bitrate= 266.1kbits/s
frame= 30 fps= 28 q=6.6 size= 51kB time=1.90 bitrate= 218.4kbits/s
frame= 40 fps= 24 q=6.6 size= ...