General :: Embed Expect In Bash Script

May 14, 2010

I am trying to embed expect in my bash script to perform some tasks

USER="username"
PASS="password"
NAMES=`cat full_list`
for i in $NAMES
do
echo $i

[Code]....

The script initially reads a files containing a list of rpm's on each line and then spawns the rpm2ipc command which uploads the particular rpm to a repository. During this process it tries to enter the credentials, where it is failing.

View 3 Replies


ADVERTISEMENT

Programming :: /usr/bin/expect : Script To Check Server Load Using Both Expect And Bash?

Jul 27, 2010

I am trying to make a script that can be used to check server load on a remote server and produces sound on our local machine, when server load exceeds a particular limit.1. I want to execute command uptime or uptime | awk '{print$10}'on the remote server and store the result in a variable(say x), and later use it in the bash script.

Bash Part
#!/bin/bash
x=$(/root/Desktop/exp)

[code]...

View 1 Replies View Related

General :: Expect: Line Seems To Match Exactly However Expect Thinks Not?

Jun 16, 2010

I am writing an expect script. At a certain point there is a rule that produces this debugging output:

Code:

expect: does " Address or name of remote host [x.x.x.x]? " (spawn_id exp8) match glob pattern " Address or name of remote host [x.x.x.x]? "? no This just times out When I use -exact for the expect keyword it does work What am I doing wrong? THe first should also match in my opinion because it is equal as well. Even if I remove the I still have the same issue if I try without -exact. I don't understand. I tried removing the but still got the same.

View 5 Replies View Related

Ubuntu :: Bash Script With Expect - Headers ?

Jul 6, 2011

I have a script which uses a function and also uses expect.

If I have #!/bin/bash as the first line, the function is recognised. The expect calls are not, failing first with spawn.

If I have #!/bin/expect as the first line, the expect and spawn work fine. The function is not recognised.

My friend Google brings up examples with both these lines one after another in script files, just like Im doing. Except for me it doesnt appear to work.

Where am I making my beginners mistake in not understanding how this works ?

View 2 Replies View Related

Ubuntu :: Good Expect Tutorial For Programing With Expect?

Nov 2, 2010

I'm trying to Use Expect to automate a curl function. basically I don't want to type enter for my script to run. Can anyone point me to a good Expect tutorial?

View 1 Replies View Related

General :: Embed Command Output In Sed Expression?

Feb 20, 2010

sed -i 's/EXTRAVERSION =/EXTRAVERSION = -$(date +%D)/g' file would search in the file, file for the string: 'EXTRAVERSION =', and change every instance it finds to 'EXTRAVERSION = -02/20/2010'. BUT IT DOESN'T.It changes it to 'EXTRAVERSION = $(date +%D)', literally. I've tried single and double quotes in almost every possible configuration. Is there any way to tell sed that one desires the command output, not the literal text?

View 7 Replies View Related

Programming :: Expect Script: Send Function Key F12 In An Expect Script?

Nov 19, 2008

I'am new to expect how do i send function key F12 in an expect script?

View 1 Replies View Related

General :: Not Able To Come Out Of Expect / Sort It?

Jun 28, 2011

I am using expect command to pass password to my script.

like code...

it will send password properly, but after that it will not come out of expect to bash.

View 4 Replies View Related

General :: Run Script From Another With Multiple User Inputs And Expect

Jun 5, 2011

I am literally bashing (pun intended) my head against the keyboard at this minute! I am trying to automate a script via cron for my centos server. The script requires two user inputs (e.g. read VAR). However, I do not want to edit the original file, as I would like to be able to run it normally as well. It is also made by someone else, and so if an update becomes available, it will be easier to install. My idea is that i create a cron script, to run this second script from, and the only way i could find was with expect. However I am having troubles, In order to test out expect, I have created the following:
test.sh

[Code]...

It looks as if the second input is completely ignored ?! what i am doing wrong? or if there is a more elegant solution to running a script from a script with user inputs?

View 2 Replies View Related

General :: Create A Expect Script To Input Username And Password?

Mar 21, 2010

i was able to input it directly from the script using this code

Code:
#!/usr/bin/expect -f
set USER "bibingeorge"

[code]...

View 5 Replies View Related

General :: Using The Expect And Send To Execute List Of Commands Inside A File?

Feb 2, 2011

i am working on some kind of PBX and i have list of telephone numbers inside a file, i have to insert these numbers into the correct command and then telnet to a remote server and execute these commands. i can read the telephone numbers and insert them into the command with no problem, but when i try to insert these commands into the send i face problem. here is the basic code

#!/bin/bash
read msisdn < input
string="ZZZZ:MSISDN=$msisdn;"

[code]....

i can make external loop inside the Bash which read the input file and issue the command and then telnet and execute, but this will make the script connects and disconnects again for each line which cause high load on that server and hardwar problem. i am wondering if there is an option inside the expect interperter which makes the send read directly from a file... somthing like this:

expect "<"
send "input-filename
"
expect "<"
expect eof

View 1 Replies View Related

Ubuntu :: How To Embed Audio In PDF Files

Nov 10, 2010

Does anyone have a recommendation for embedding audio files into PDF files? I'd like to use this to provide feedback on student papers. Acrobat full version does this, but I'd like to stay in Ubuntu.

View 3 Replies View Related

Ubuntu :: How To Embed Cover Art In Songs

Jun 25, 2011

Is it possible to embed cover art in songs by any application in ubuntu? Preferably by banshee media player or any media player which shows cover art.

View 3 Replies View Related

Ubuntu :: Can't Embed Video On Webpage

Jul 22, 2011

I'm trying to embed a video on my website, and It keeps asking me if I want to save it, instead of just playing it. How do I embed to play and not pop-up the "save" dialog?

Today I demonstrated a simple SSH dictionary attack for a friend. Lucky for you - I also recorded it. (I've made my pw ridiculous and re-secured the box so don't even try it now lol - it'll take 100's of years to crack brute-force).

Anyways, here's what you'll need:<ol><li><a href="http://nmap.org/" target="_blank">NMap</a></li>
<li><a href="http://www.foofus.net/~jmk/medusa/medusa.html"

[Code]....

That's what I have. It shows the box where the video should be - but doesn't play it, just asks to save. Not sure if it's something with my browser plugins... or my code on my page... ? Tried with FireFox and Rekonq - same results. Tried with many different embed codes as well - all same results.

View 1 Replies View Related

Server :: Embed Grails 1.2.2 In Apache2?

Apr 30, 2010

I downloaded grails [URL]... and installed it. Created a sample application hello world. It was running successfully. In browser [URL].. I was able to see grails running. Now comes the problem. To be able to always start the grails application running after boot I wrote a script in /etc/init.d/software_grails its contents are

[code]...

I have to open command prompt and go to /root/helloworld and then execute grails run-app. you dont have to write the name of application to run it. logging of boot messages is enabled /etc/default/bootlogd BOOTLOGD_ENABLE=Yes. then I opened /var/log/boot.

[code]...

But it does not work. If I am not wrong then above method will work ONLY WHEN some one Logs in not on boot time. Is there a way where I can embed grails in apache2 they [URL]... have not mentioned any thing about apache2 to deploy my applications.

View 2 Replies View Related

Ubuntu Networking :: Rsync Over SSH - Embed Logon Credentials?

Jan 18, 2010

Is there a way to embed the user password in the following code?

Code:
rsync -r -n --progress --delete -u -l -e ssh 192.168.1.9:/Volumes/1TB_Internal/Music "/media/Storage/Libraries/My Music"

[code]...

View 4 Replies View Related

Ubuntu Multimedia :: How To Embed Flash Video In Blog

Feb 16, 2010

i have this blog, and i want to embed flash vids in it like videos. however, i want to do this from my apache2 web server, partly for bragging rights among my non-techie circle of friends, but mostly because i cant get videos to do what i want (which is private viewing of vids by non-..... members). any tips on how to do this?

View 6 Replies View Related

Ubuntu Multimedia :: Embed Media Player In Webpage?

Apr 29, 2010

I have a file server running Ubuntu Server. No monitor or input hooked up...I just ssh into it for maintanance. I use it to store all of my music and video files. I was watching Hulu at work today and thought it would be nice if I could somehow stream or play my files from my file server while I was at work.

I have apache set up so I can serve websites from it so I was thinking if I could some how select the file to play and it play it in an embedded player, that would be fine. I'd like it to play music and videos.

Is there any way of going about this? I have minimal HTML experience, but I have extensive C/C++ experience and server experience. So I'm comfortable using some open source libraries to accomplish this.

View 1 Replies View Related

Ubuntu Multimedia :: Embed Subtitles In Video File?

Apr 30, 2010

I have a film that has been split into 2 files, both of which has an associated srt subtitle file.

I want to embed the subtitle file permanently in the films, so I can subsequently combine the 2 video files (and so have continous playback).

I've tried playing about with Avidemux but no joy so far. Can anyone point me in the right direction?

View 3 Replies View Related

Ubuntu :: Impress Unable To Embed Sound Files?

Aug 6, 2010

Back in my Windows days I used Power Point but now that I am a Linux guy I use OpenOffice Impress instead. First, even in power point if I embedded sound files I had to make sure they were .wav files, and in this format they grew very large. I have been told that I can embed a .wav file in Impress, but there is a limit of 100k on the file size. Also there is a place where you can change this limitation, but I can't find where to change it. Does any one know where this setting is?

Next, let me tell you what I am trying to do and maybe someone has a better way of doing it. I have slides in my presentation where I display text and have sound files that read the text that is displayed. I have a couple of ways to do this, but both ways are just inserting sound files into the slide. All this does is point to the sound file and then plays it. This works find until I want to transfer it to another computer. To get the presentation to run on another computer I would have to re-insert the sound file so the pointer was right.

So this means I need to not only copy the presentation over but the sound files also. My main question: Is there a better way to do this? Even if I have to use a different program if Impress is unable to embed sound files. I believe that both Power Point and Impress both fall short in this area. I am trying to stay away from developing a program to do this. There must be something out here in the Linux world that would fit the bill?

View 8 Replies View Related

Ubuntu Multimedia :: Embed Audio File In Image?

Feb 25, 2011

Is it possible to embed audio file to an image in ubuntu?

It's possible in Windows 7, when saving just the image from an imagechan.

View 1 Replies View Related

Software :: Evince Doesn't Embed Correctly With Mozplugger

Apr 2, 2010

I have installed Mozplugger and changed mozpluggerrc so it opens evince. However, it shows an embedded version in the tab that doesn't accept interactions and opens the version that can be interacted with in a new window. Does anyone know what may be causing this? I'm not very knowledgable with the specific commands in mozpluggerrc.

My current setup for PDF files is as follows:

View 2 Replies View Related

Programming :: Embed Variable Definitions Within Constants So They Can Be Interpreted?

Jun 30, 2011

Say I have arrays of constants code...

Is it possible to induce bash to interpret the ${tbl[1]} part to its actual value (1-6) when I reference those particular entries in the arrays?
Using this instruction to do so code...

View 9 Replies View Related

General :: Embed "DISPLAY" Variable In "su" Command?

Sep 8, 2010

I'm trying to create mozilla profile for another user from command line using su. When I'm trying from X, this will work. su myuser -c 'mozilla -CreateProfile newprofile' But my goal is to embed this to a script and it will execute only in command line mode. If I try this, from a command line, It also works: ISPLAY=1.0 mozilla -CreateProfile newprofile how to embed "DISPLAY" variable in "su" command, cause this fails: su myuser -c 'DISPLAY=1.0 mozilla -CreateProfile newprofile'

View 5 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

General :: Running Bash But Common Bash Commands Not Working?

Jul 17, 2010

below are the details of my system. I have bash as my current shell, some really common commands aren't working.

Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])

Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$

[Code]....

View 13 Replies View Related

General :: Running Shell Script Within Expect Script?

May 1, 2011

I Want to run below script withing expect utility

Code:
mystring "abc:-)"
mystring1=${mystring/)/.}

View 2 Replies View Related

General :: Run Expect Script Within Another Script?

Jan 18, 2011

I want to run an expect script generated using autoexpect within another script,the expect script has to go into super user mode execute some commands and then exit and come back to user mode.When the script is run in the command line it works fine,i want the script to run within another script

View 7 Replies View Related

Programming :: Send '/' In Expect?

Aug 9, 2010

I'm trying to use expect to telnet to web server and send HTTP command like POST, GET, etc.

Here's my code...

But this gives an error

couldn't read file "/cgi-bin/authgw-cgi": no such file or directory

I think this is because of /

How to send / in expect?

View 3 Replies View Related

Programming :: Control VI With Tcl And Expect?

Mar 7, 2011

I'm using expect to log into a remote server and run a script. I want to able to have expect edit the output from that script, on the remote server, in VI. Has anyone ever done this before, it seems as though the expect interpreter has nothing to expect once VI is started, the file pointer starts at the beginning of the line, and expect usually reads the characters before the pointer.

spawn ssh user1@$remote_server
expect "password: "
send "$password

[code]....

View 2 Replies View Related







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