Python get the expect value from a variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Python get the expect value from a variable
# 1  
Old 08-21-2014
Python get the expect value from a variable

Code:
the value of the variable is 

yes
 group=bsp_16
 keyword="82599"
 test_var="-a xxx -b yyy"

I want to get output with

Code:
-a xxx -b yyy

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Python variable at different position

I have a file which records banking transactions say like below. user1 has deposited 10,000$ in his account user2 has deposited 11,000$ in his account user1 has withdraw today 5000$ from his account. Lets say i read this file and convert each line as a list. username= word action=... (1 Reply)
Discussion started by: sahil_shine
1 Replies

2. UNIX for Beginners Questions & Answers

Getting error while using date as a variable in expect

Hi getting error when i am saving date command output in a variable and then using the same variable in expect #!/usr/bin/expect set DATE spawn sftp AUT#XX.XX.XX.XX spawn echo $DATE expect "password:" send "AT123\n" expect "sftp>" send "cd /home/ \r" expect "sftp>" send... (12 Replies)
Discussion started by: scriptor
12 Replies

3. Shell Programming and Scripting

Expect Redirecting o/p to an Variable

I have a password reset expect script which stores all the op to an file. I need to check the whether password is successfully changed by greping out the file and storing the o/p to a variable. But we try to print the variable , its shows only the command instead of its o/p. ... (2 Replies)
Discussion started by: sudharson
2 Replies

4. Shell Programming and Scripting

Python update variable name in for loop

Hello all, Not sure if this question has been answered already. I have some xml Element variable as below: child19 = core_elem_dcache.find('stat') child20 = core_elem_dcache.find('stat') child21 = core_elem_dcache.find('stat') child22 = core_elem_dcache.find('stat'Next I... (2 Replies)
Discussion started by: Zam_1234
2 Replies

5. UNIX for Advanced & Expert Users

Calling expect from shell script which inturn call python

Hi Team, I have to execute a task from my local machine, where i keep my .expect,.sh, .bash and .python scripts .Task are coded in the script and has to be executed at remote machine. for that i used following task ..... SCRIPT 1: cat shell_check.sh read value if then expect... (3 Replies)
Discussion started by: Sivarajan N
3 Replies

6. Shell Programming and Scripting

Variable Substitution in Python

Hi, Please I have the following python code. x = time.strftime("%Y_%m_%d") os.system("/gsn/mme/parse_ebm_log.pl -x /gsn/mme/ -u -r gsm -f /gsn/mme/mme01/ebs/A* >> /gsn/mme/mme01/+ str(x)_gsm.txt") os.system("/gsn/mme/parse_ebm_log.pl -x /gsn/mme/ -u -r wcdma -f /gsn/mme/mme01/ebs/A* >>... (2 Replies)
Discussion started by: infinitydon
2 Replies

7. Shell Programming and Scripting

How to pass variable with spaces from shell to expect?

I need call expect script from shell script and pass values some of which could contain space. How to make expect to treat such values as one variable? (1 Reply)
Discussion started by: urello
1 Replies

8. Shell Programming and Scripting

Assigning last line to variable in expect

As part of an expect script, I have to convert a strange user ID to a conventional UNIX ID. To do this, I read the contents of a file and do a little awk magic. Here's that bit of the expect script: send "awk 'NF == 10 && \$NF == strange_user_id {print \$(NF-2)}' file_with_my_info\r" expect... (0 Replies)
Discussion started by: treesloth
0 Replies

9. Shell Programming and Scripting

passing variable to expect

Please tell me how to pass variable "a b c" to expect from the shell script 1/ example of input file # cat in-file var1 var2 a b c var4 2/ # this is my script - how to pass "a b c" as single variable ? cat in-file | while read x do my-expect x done 3/ # expect script - how to... (0 Replies)
Discussion started by: breaktime123
0 Replies

10. Shell Programming and Scripting

Transfer variable to an expect function

Hi There, I try to transfer a variable from the script to a function which use expect, but I don't succed. #!/bin/sh HPPASS1="$2" send_command() { echo "spawn ssh login@10.10.10.10" echo 'set password ' echo 'sleep 1' echo 'expect "*assword:*"'... (5 Replies)
Discussion started by: sylvainkalache
5 Replies
Login or Register to Ask a Question
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)