Programming :: Embedding Command In Jython Script?

Jan 28, 2010

I am trying to embed a command in a Jython script. The version of jython does not support popen so I am using os.system("pmap -x %s | tail -n1 |cut -f2 -dB" % (pid)) to get the memory consumption of a pid and pass same into my Jython script. The problem is that my code which looks like this:

cmd = "pmap -x %s | tail -n1 |cut -f2 -dB" % (pid)
memusage = os.system(cmd)

executes properly but does not assing the result into the variable "memusage". So when I used the variable elsewhere I get "0". How do I manage to get the variable to grab this value rather than it executing directly.

View 1 Replies


ADVERTISEMENT

Programming :: Embedding Flash To Html Pages For An Rtmp Stream

Aug 2, 2010

I am having a streaming server Red5 running on localhost. I have a few HTML pages which should be serving those streams.

I read documentation given here [url] and [url]and the swfobject.js and player.swf are on same directory where the test.html page I created is present.

Following is the HTML code
Red5 is working on localhost.

Code:

View 9 Replies View Related

Ubuntu :: How To Install JES (Jython Environment For Students)

Aug 25, 2010

I have Ubuntu 10.04 and i am taking a programming class and I can not figure out how to get this to work.I downloaded JES from linux and I do not know what to do from there

View 3 Replies View Related

Ubuntu One :: Embedding MOV Files ?

Sep 1, 2011

I know DropBox allows this for mov files where you can get the link and just quickly embed it on your blog or a forum.

Is there a way to do this with the published link that I get from UbuntuOne ?

View 2 Replies View Related

Ubuntu :: Existing MySQL Embedding To FTP

Jan 27, 2010

I have question about embedding existing mysql data to FTP. Let me tell you how the system works. Apache gets the user name and passwords records to the MYSQL and creates a folder per user in server. However users can not access their created folder using FTP client software. So how am I gonna merge the existing user/password data in MYSQL ---> to the FTP user/password. Vsftpd and proftpd installed already, so in whichever you feel more knowledgeable, I can go with that.

View 5 Replies View Related

Fedora Servers :: Flash Packages For Embedding Flv?

Jun 2, 2009

flash packages for embedding flv?

View 2 Replies View Related

General :: Embedding Python Script In C Program?

Apr 7, 2011

How can i embed python script in C program?

View 1 Replies View Related

Ubuntu :: Grub2 Embedding Area Is Unusually Small?

May 4, 2011

I lost my capability to boot into any OS for some reason. I am dual booting Windows 7 and Ubuntu 10.10 and I have managed to restore my Windows bootloader using a Windows repair disk.I have tried to reinstall Grub using these commands from a Ubuntu Live CD:

Code:

ubuntu@ubuntu:~$ sudo mount /dev/sda6 /mnt
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/mnt /dev/sda

The latter gives this output:

Code:

/usr/sbin/grub-setup: warn: Your embedding area is unusually small. core.img won't fit in it..
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.

Here are the results from the boot info script:

Code:

Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: =============================
=> Windows is installed in the MBR of /dev/sda
sda1: _________________________________________________________________________
File system: ntfs

[code]....

PS. I probably should mention that I edited the partitions prior to these problems, moving the extended sda3 to the left to give it some more space. The order of the partitions remained unchanged.

View 4 Replies View Related

Ubuntu Installation :: Grub-setup: Warn: Your Embedding Area Is Unusually Small. Core.img Won't Fit In It

May 3, 2011

I would like to backup my entire Ubuntu installation (/boot, swap and /) at /dev/sda (4GB) to /dev/sdb (10GB).I recreated the exact partitions on /dev/sdb, formatted and cp -rp all the files over.For /boot, I used

Code:

dd if=/dev/sda1 of=/dev/sdb1

It didn't boot successfully as the system kept rebooting. I then tried to install grub onto the MBR and boot partition (mounted at /mnt/tempboot).

Code:

grub-install --force --no-floppy --root-directory=/mnt/tempboot /dev/sdb

But I get an error:

Code:

grub-setup: warn: Your embedding area is unusually small. core.img won't fit in it.

Anyhow, since I forced grub-install, I believe the grub is installed. I rebooted the system and I get a grub prompt:

Code:

grub>

Grub seems to not find my grub.cfg but it is present.

View 1 Replies View Related

Programming :: Effect Of Using Eval To Execute A Command As Opposed To Writing It On The Command-line?

Jun 18, 2010

Code: cmd='date | wc'

$cmd If this script is executed, an error is generated. The reason written was that "The execution fails because the pipe is not expanded and is passed to date as an argument".What is meant by expansion of pipe. When we execute date | wc on the command line, it goes fine.then | is not treated as an argument. Why?

View 4 Replies View Related

Programming :: Command Line Invocation Of Gnome-terminal To Run More Than One Command?

Feb 16, 2010

I am trying to learn how to pass more than a one-command startup for gnome-terminal.

I will give an example of what I'm trying to do here:

Code:
#! /bin/bash
#
#TODO write this for gnome and xterm
USAGE="
${0##*/} [-x] [-g]
code....

However, running with the -g option to invoke gnome-terminal, I get a "There was an error creating the child process for this terminal" error.

This same error occurs if the gnome-terminal line is changed to

Code:
gnome-terminal -e mcTerm

Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.

View 4 Replies View Related

Programming :: System Command / 'mcc' Is Not A Recognised As An Internal Or External Command?

Apr 13, 2010

I am writing a perl script which uses the matlab compiler to compile a .m file.

I am using the system("mcc �m file.m"). I have matlab installed and both script and exe are in the same drive.But i get the following error .

'mcc' is not a recognised as an internal or external command ,operable in program or batch file.

View 5 Replies View Related

Programming :: Show The Output Of Shell Command Into A Textbox, Ex Ps -efc Command?

Oct 20, 2010

I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?

View 3 Replies View Related

Programming :: Convert This Awk Command From Command Line Into An Awk Script ?

Oct 15, 2010

I'm trying to convert this awk command from command line into an awk script, but just cannot get it to work:

This is what i have after my BEGIN

Am i missing something here? this just prints out the count for everyline, not counting lines on 5th field that match 'A'

View 1 Replies View Related

Programming :: Calling Command From History Using Variable Like !$command?

Nov 19, 2008

suppose i store the history number of a command say :

1004 cat file

Then now i want to run it like : !1004 but by using a variable.

command=1004
!$command

i am getting errors like :

command=1004command

View 2 Replies View Related

Programming :: Bash Ambiguous Redirect - Redirect One Command Output Which Will Be Treat As A Content Of File For Another Command?

Mar 9, 2011

I am trying to grep multiple numbers from file, grep does have the -f option for that.

Code: grep -f <`seq 500 520` /etc/passwd I know this could be done with

Code: for i in `seq 500 520`; do grep "$i" /etc/passwd; done But my question is fare more behind this example. It is possible to redirect one command output which will be treat as a content of file for another command ?

View 2 Replies View Related

Programming :: Command To Run Another One On Few Lines

Jul 23, 2010

Is there a command which can be used to run some other command on a few lines from a file or an o/p of some file. (the kind of role that -exec option does for the find command). (I have solved the purpose using a bash loop but would like to know if there exists a command).

View 4 Replies View Related

Programming :: Cp Command -f Is Not HAPPENING?

Mar 20, 2011

What's the deal with this bloody commandI trying to do an update of a product.The -f is suppose to "force" the overwrite of existing files isn't it?Well every time I run the command it keeps asking me to allow it to overwrite the files.. the programs is too long for me to sit here hitting the "y" and "enter key"

View 2 Replies View Related

Programming :: Use The Seq Command But Can't Get It To Work?

Mar 24, 2011

I have a script that will build a list of hosts and it works fine Code: for ((i=$START; i<=$END; i++)); do echo "$NAME$i"; done But I need it to build the START and END on different number formats (i.e. 1 -> 10, 01->10, 001 ->010)

I am trying to use the seq command but can't get it to work quite right with the -w flag in the following Code: for ((myseq=$START; myseq<=$END; myseq ++)) do echo "$NAME${myseq}" done I am fully aware that this syntax is probably wrong, and need to know how to correct it.

View 1 Replies View Related

Programming :: Add New Command In Minix?

Mar 12, 2011

Is anyone familiar with the Minix OS? i want to know what is the Process to add a new command in Minix that uses system call served by the memory manager server

View 1 Replies View Related

Programming :: Bash Command From PHP?

Jul 14, 2011

Distro: Centos 5, PHP 5I have done a bit research on running bash commands from php and there was little success. This is my relevant php script

<?php
echo exec('pwd');
?>

[code]...

View 16 Replies View Related

Programming :: Get The Getopts Command To Run?

May 12, 2010

im trying to get the getopts command to run but for some reason the -d option fails to populate the variable and it remains empty.

Code:
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options

[Code].....

View 2 Replies View Related

Programming :: How To Integrate Ls Command In C++

Aug 19, 2010

I just create a simple c++ program on linux is there a way to intergrate linux command such as ls, du, df and etc on my c++ program?

View 1 Replies View Related

Programming :: Use Fg Foreground Command?

Apr 16, 2010

I have many processes running that printf local debug. (they will log to file later!) I start them by

Code:
( sleep 20000000 | fp ) & else they get killed/stop by themselves. So now its running in the background, I want to bring it to the front to see the printfs.

[Code]....

View 14 Replies View Related

Programming :: Joining Command In Csh?

Feb 3, 2009

I did a search for this but did not see anything relevant.I'm trying to join several strings and execute them as a command but csh does not seem to recognize it as a command, anyone know what I'm doing wrong? numone and numtwo will be passed into the script. (I have to use csh because it is a part of an existing script.)

Code:
#!/bin/csh
set file1=file.dat

[code]...

View 5 Replies View Related

Programming :: Using Sed Command Twice On One File?

May 11, 2009

what i have is a list of words 6 to a line im trying to use the sed command to insert a comma in between each word and at the end of the last one

[code]....

the last line of the variable does not have 6 words what i have so far is this

Code:

words=`cat /usr/share/dict/words |grep "^[$list]*$" | xargs -n 6 echo | sed -e 's/[ ]+/,/g s/$/,/g'`

it dosent work though i originally started off with

Code:

words=`cat /usr/share/dict/words |grep "^[$list]*$" | xargs -n 6 echo | sed -e 's/[ ]+/,/g' this puts a comma inbetween them but takes out the space and dosent put a comma at the end of the line.. basicaly what i needed to know is how i could you multiple sed commands to fix this

View 12 Replies View Related

Programming :: How To Create Sed Or Awk Command

Apr 7, 2011

How would I create a sed or awk command that would add a | to the end of a line if it wasn't already there? I'm trying to import some files into mysql, but some of the lines to not end with a | which is my field delmiter.

View 14 Replies View Related

Programming :: Using Variable In A Command?

Apr 14, 2011

i'm trying to execute a shell script, i'm trying to use the values in an array for use in a sed command:

sed -n '/Sales ID: ${array[$i]}/,/Totals:/p'

that command creates empty files. so my guess is that its not recognizing the array as an array but as text?
how would i be able to utilize the array in the command? i got it, didnt think that if i doubled up the single quotes that it would work, but this worked:

sed -n '/Sales ID: '${array[$i]'}/,/Totals:/p'

View 4 Replies View Related

Debian Programming :: How To Use Shell Command

Sep 6, 2013

How to use shell command?

installs.sh:

Code: Select allapt-get install icedove-l10n-hu
apt-get install rar
apt-get install ...
...
y press key or other language is other key. hungarian key is: i

english after apt-get install in gnome-terminal: (y)es or (n)o
hungarian after apt-get install in gnome-terminal: (i)gen or (n)em

How to yes or no automatically in all languages? Not manual, not 'Y'/'I' or 'N'/'N' keydown.

I would like use this script my fresh installed Debian 7.1. I would like run this install.sh when Debian is installed for my all softwares when i would like use.

10 PC installing easy and faster my script.

If no script is slowly install for my 10 PC.

View 2 Replies View Related

Debian Programming :: Sh Command Strings

Feb 8, 2014

I use udhcp with some of my minimal installs. I've messed around with the code a bit when it wasn't working correctly - a few years ago. I will find time - I hope soonish - to figure out how to do a few other things with it.

For now though, I'm using this string to grab my ip after startup

Code: Select allsu -c 'ifconfig eth0&&ifdown -a&&ifup lo&&ifup eth0'&&/sbin/ifconfig eth0

I realize I could substitute ifup -a but I'm more interested in figuring out how to make ifup wait for the ip to become available if it is not available yet.

Never mind that one, just typing out the question answered it for me, when I find it in the scripting man ' ; : " & =

Or if there are any other suggestions for better construction of the string.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved