How to skip the first line of the script in shell using python?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to skip the first line of the script in shell using python?
# 1  
Old 06-29-2012
How to skip the first line of the script in shell using python?

How to skip first line of the script in shell, using python.
# 2  
Old 06-29-2012
If you're working with a file object in python, just use the readline method and don't use the return value.

If that doesn't apply, then restate your situation with some detail, including sample data (including input and desired output) and what you've tried so far and how it failed.

Regards,
Alister

P.S. If this is indeed a python question, it belongs in the programming forum, not shell scripting.
# 3  
Old 06-29-2012
Thanks alister,

First i am calling fab in shell script to get the value from python, and in python im returning to shell.

This intercall is happening in round robin, so in the second call to shell, i need to skip first fab request and should go to next step
# 4  
Old 06-29-2012
Without seeing the code, I have no idea what you're trying to accomplish and what the implementation looks like. You're unlikely to receive any useful advice if you don't share the shell and python scripts. If it contains sensitive info (passwords, hostnames, ip addresses, etc, replace that with xxxxxx). If it's a lot of code, try to reduce it to a minimal case which accurately reproduces the problem.

Also, I'm assuming fab refers to Fabric. If not, please elaborate. Don't assume that someone who knows the programming language is familiar with all tools.

Regards,
Alister
This User Gave Thanks to alister For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Feed python with read line in shell

Hello, I am running under ubuntu 14.04. I have a python file bringing requested data. When I run, it asks me to enter query info. After that, it gives the data if anything matched can be found. What I need to accomplish is, instead of entering the requested data from keyboard, to put all... (11 Replies)
Discussion started by: baris35
11 Replies

2. Shell Programming and Scripting

Shell script inputs to python

Hi I am trying to pass 2 input parameters from shell script to python API end point ,but not passing what i expected when print those inputs .Please advise data.txt " 7554317" ,xx5e1 " 7554317" ,xx96 " 7554317" ,xxd6 " 554317" ,xde cat $sites/data.txt |sort |uniq >$sites/a.txt... (5 Replies)
Discussion started by: akil
5 Replies

3. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

4. Shell Programming and Scripting

Skip to next line if the variable is string

Hi I have the follwoing requirement I have a file as follows: # cat priy yyy.poweroff_cmd = /sbin/poweroff hhh.powersave-nap = 1 When this file is provided as input, I first used "awk" command and saved variables present after "=" replace=$line replace1=`echo $line | awk -F "="... (3 Replies)
Discussion started by: Priya Amaresh
3 Replies

5. Programming

Regarding Python Program with Shell Script

Hi All, I have written a shell script which is using the expect method, it is working fine in terminal window, and then I have executed via python script its also working fine in command prompt functioning properly, I used subprocess.Popen method to execute the shell script file, its working... (0 Replies)
Discussion started by: janaefx
0 Replies

6. Shell Programming and Scripting

Skip first and last line

Hi All I have a sample file like below: 012312112 1372422843 1236712 1372422843 1275127 3109301010 from which I wan't to: 1.)delete... (10 Replies)
Discussion started by: swasid
10 Replies

7. Shell Programming and Scripting

Passing variable from shell script to python script

I have a shell script main.sh which inturn call the python script ofdm.py, I want to pass two variables from shell script to python script for its execution. How do i achieve this ????? Eg: main.sh a=3 b=3; c= a+b exec python ofdm.py ofdm.py d=c+a Thanks in Anticipation (4 Replies)
Discussion started by: shashi792
4 Replies

8. Shell Programming and Scripting

Unix Shell scripting -How to skip User Standard input section from another script

All, problem Description: For example: I have two shell scripts(executables). let name it as script1 and script2.I'm trying to execute script1 from script2. while executing script2, script1 is asking for manual input(input from keyboard). Now i need to know how I can skip this user input... (3 Replies)
Discussion started by: techie99
3 Replies

9. Shell Programming and Scripting

Output of Shell Script Doesn't Skip to next line

Hi. This is what I coded: tput cup $1 $2 # place cursor on row and col tput clear # clear the screen bold=`tput smso` #set stand-out mode - bold offbold=`tput rmso` # reset screen - turn bold off echo $bold # turn bold on tput cup 10 20; echo "Type Last Name:" #bold caption tput cup 12... (3 Replies)
Discussion started by: Ccccc
3 Replies

10. Shell Programming and Scripting

Skip new line

Hi, how can I skip the new line of echo? In SH!!!! echo "the date is :" date and result I want is the date is : Tue Oct 11 22:24:37 WEST 2005 I've already tried including the \c inside the echo, but it didn't work. Thanks! (2 Replies)
Discussion started by: pmpx
2 Replies
Login or Register to Ask a Question