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


ADVERTISEMENT

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 :: Shell Script For Telnet Using Expect - Unable To Find The Tutorial

Jan 22, 2010

I need to open a telnet session using a shell script that follows this format:

telnet 10.100.0.1
expect "Password:"
send <password>

[code]....

send "pen" (till the end of lines generated as in |more.... usually we use like 8 space bar buttons after "pen" to generate all)
and I want to redirect the whole generated result of "pen" to results.

View 3 Replies View Related

Ubuntu :: Shell Curly Braces With Double Quotes Does Not Expand As Expect?

Jan 13, 2011

I'm really new here this is the first try to get some knowledge here.I have a littele question."echo {1,2}" does expands 1 and 2.so does "echo "`echo {1,2}`"".But when I do it with double quotes which is "echo "{1,2}"" it doesn't expand at all.why does this happen? I have read man for bash but could not get any clue.

Yuki
Code: -- the output i see --
sh-3.2# echo {1,2}

[code]...

View 3 Replies View Related

Programming :: Can Expect Return Control Of A Spawned Process To A Shell Script

Nov 19, 2009

Is it possible to have an Expect script spawn an SSH session, log in, then go into interactive mode and give control of the SSH session to a Bash script? Here's a simplified example of the script so far:

Code:
#!/bin/bash
expect -c "

[code]....

View 4 Replies View Related

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

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 :: Running An ASP Page From A Shell Script?

Jun 18, 2011

I am trying to access an aspx page which, when accessed with certain parameters in the URL, downloads a file. I need to do this with a shell script, rather than interactively. I tried using wget, but I get a response of 302 from the server, which redirects me to the default page and then downloads the default page html itself. I quickly tried curl which seemed to be doing the same thing. It works perfectly from browsers on either Linux or Windows. Originally, I had a problem with interpretation of ampersands in the URL, but I put quotation marks around the URL, so that isn't the problem now.

I cannot fix this on the server side, because the aspx page will be accessed on a variety of servers which are probably all set differently and which aren't under our control.

View 5 Replies View Related

General :: Running Shell Scripts With Cron

Sep 24, 2009

I've been having a bit of trouble running a shell script with cron. A friend of mine does a community radio show and the station has a live stream but no podcasts, so I've set up a script to record the stream and encode it as an mp3 while I'm away using mplayer and lame -that's what I'm trying to do anyway.

Here's the script, but it doesn't seem to run- at least, I don't see any of the files it should be outputing, would they be in the cron.weekly directory (where I have the script) or in my home directory?

#This is a script to record 'The Unnamed Show'

#it will record the show from the live stream, then convert the output #to an MP3

#Finally, it will delete any files no longer required HOME=/home/byron/

View 2 Replies View Related

General :: Running My Shell Scripts As Root ?

Aug 18, 2010

I have been playing around with shell scripting, nothing too complex just learning the basics. if i try to run a script as root (by entering "sudo" then the "command") it says command not found. i can only do it ass root if i specify the full path (/home/username/bin/command) im pretty sure the directory that my scripts are in are part of the superusers path.

View 14 Replies View Related

General :: Running A Shell Script In E-mails?

Mar 11, 2011

I know that shell scripts can be used to execute more than one linux command at the same time. But can the same be performed in an e-mail (i.e) whenever i open that specifice-mail, the linux command should execute.

View 6 Replies View Related

General :: Shell Script Searches Processes Running?

May 20, 2010

how to write a shell script the searches for processes running on my system. I really don't know where to start. can anyone give me a hand and explain how the script works?

View 3 Replies View Related

General :: Pass Parameters To A Shell Script Running As Cronjob?

Dec 7, 2010

I am new to bash scripting (not programming in general).

I am writing a bash script that will run a Python script I have written.

I want to be able to do the following:

Pass parameters to the bash script via the cronjob (so I can have two cron jobs) one to be run with parameter 'foobar', and the other 'foo'
switch based on the parameter passed to the bash script (by switching, I mean an if/else based on the paramter passed to the bash script).

View 3 Replies View Related

General :: List The Currently Running Processes Via Code A Shell Script?

Feb 5, 2011

how to list the currently running processes via code a shell script. FYI i now about the top method in the terminal but i need a way to have it via a shell script.

View 4 Replies View Related

General :: Running Shell Program On Startup As Root In Terminal

Aug 4, 2010

I am running Linux Mint 9..I play xbox live and run it through my laptops wireless network connection so i dont have to pay 100 dollars for the usb wireless adapter for the xbox. In windows 7 this is easy to configure so that when i turn my laptop on and then xbox it automatically connects.

View 10 Replies View Related

General :: Measuring Time That A Program Is Running In Shell Script

Nov 11, 2010

I have a script that executed 100000 C Programs, reads the commands from a file and executes them. There is a requirement to measuer the time that each of this 100K C programs running.If it exceeds 120 sec I want to Kill that Process.Any Idea to embed this in my shell script?

View 4 Replies View Related

General :: Shell Script To Check Whether Mysql Server Is Running Or Not

Apr 27, 2009

from nmap localhost | grep mysql command i will come to know whether mysql server is running or not.my problem is i want to test whether mysql server is running or not in shell script and if it is running i need to tell the user to stop the server to run the shell script.

View 3 Replies View Related

General :: Continue Running A Program Inspite Of Killing The Shell Which Invoked It?

May 31, 2011

Possible Duplicate: Leave bash script running on remote terminal while not logged in? I run a program, say ./a.out 10 from the shell prompt. Assume that there's a while(1) inside the program being run. Now if I try to close the shell, it warns me that it'll kill my running program too! So, how to kill the shell and still let my program continue running in the background?

I tried exec ./a.out 10 but the shell is still there. Another alternative is to simply double click my executable but then how will I pass command line parameters?

View 2 Replies View Related

General :: Running Shell Script Taking Command Line Arguments In A Jsp Page?

Feb 10, 2011

how to run a shell script taking command line arguments in a jsp page.

View 1 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 :: 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 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 :: Running XP In A Shell In 10.10?

Apr 18, 2011

Basically I want to be able to run XP in a shell inside the Ubuntu environment (as opposied to just having duel install.

Is this possible? Stable? Realistic?

Its only for gaming really as I don't have all that much luck with Wine.

View 5 Replies View Related

Ubuntu :: Running Shell Script From Terminal?

Feb 14, 2011

I have a shell script that I want to be able to run from the terminal just by typing "topcat", regardless of where I am or what user I'm under. How would I go about changing the bash configuration files (if I have to) in order for that to work, for me and for the other users on the computer (I have root access)? As it stands right now, I have to type "/bin/topcat/./topcat" in order for it to execute

View 3 Replies View Related

Server :: Running A Shell Script With Perl?

Jun 27, 2009

quick guidance on running a bash script using Perl. The script is calledarchive_web.sh.The regular script I have and use now (archive.sh) creates an archive directory (uses the current date as the dir name) and moves all existing files there.The script is cronned to run every day before midnight. I'd like to be able to run this "archiving script"manually, from the web, at my own discretion, rather than necessarily wait till midnight (but want it to run then, too, in case any new files present themselves in the directory).These shell scripts sit in an .htaccessed directory. Talk about making up verbs all over the place.

View 1 Replies View Related

Software :: Running A Shell Script From Cron ?

Jul 1, 2010

Im having some difficulties with running a shell script from cron which I am unable to resolve for almost 2 days now.

For testing purposes, im trying this with simple shell script test.sh with chmod 777

This script is located at /var
When I type /var/test.sh it runs perfectly and prints asdasdasd
When I type /var/test.sh > /home/log it writes asdasdasd to /home/log - works

The problem occurs whenever I add it as a cron job to var/spool/cron/crontab/root

There is: 11 10 * * * /var/test.sh > /home/log - however, at 10:11 there is no file at /home/log

Cron as a service works, forexample, every day at 4 am it makes this backup sshpass -p xxxx rsync -avz -e ssh root@x.x.10.7:/data/backup/ /home/backups/isp_admin

However,

doesnt makes the folder

Where is the catch?

View 3 Replies View Related

Programming :: Running Shell Script Using Cron Job

Jul 8, 2011

I am using Shell Script to run my Java program. I have written a Cron job to invoke Shell Script every day at 7pm. Cron job is running every day at 7pm ,but it is not invoking my shellscript and also I am not getting any error message. I am able to run same shell script from cmd propmt using bash, and also I am able to invoke the same script from mainframes Universal command job. Same ShellScript and Same cronjob is working fine in my Dev server. But in my QA server it is not working.

View 7 Replies View Related







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