Sponsored Content
Top Forums Shell Programming and Scripting How to use scl enable python command call with in bash shell script? Post 303029223 by cplusplus1 on Wednesday 23rd of January 2019 11:32:36 AM
Old 01-23-2019
How to use scl enable python command call with in bash shell script?

I have a bash shell script, within it i am using the below two commands . its failing right on scl enable command itself.

if i run it by itself without a shell, it works fine.

by default it is using pythin version 2.6 something. i want to use 3.4 version for that reason with in the shell script using below python side calls.
need help please how to properly use the below two lines within bash shell script.

Code:
scl enable rh-python34
python 'excel2csv.py' '-P' 'Khai123' '/usr/local/bin/ltchadoop/stage_process/weekly_pim/test_temp

'

Thanks a lot for the help info.

Last edited by jim mcnamara; 01-23-2019 at 12:44 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do i tell my bash shell script to test the output of a command against something

How do i tell my bash shell script to test the output of the command i'm using?? I want this script to look for lines not equal to 1 then let me know.. $ cat blah ; echo ---- ; cat blah.sh 1 fe 1 fi 1 fo 0 fum 1 blahda 1 blah 0 blahh 1 bla 1 bl 1 blahhh ---- #!/bin/bash while... (1 Reply)
Discussion started by: phpfreak
1 Replies

2. Programming

Python: bash-shell-like less functionality in the python shell

Hello, Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells? Example: >>> import subprocess >>> help(subprocess) ... ... I'm hoping so as I hate scrolling and love how less works with... (0 Replies)
Discussion started by: Narnie
0 Replies

3. Shell Programming and Scripting

rm:command not found in linux Bash shell script

Hi All, Linux lxs3er06 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 i686 i386 GNU/Linux Issue: While executing shell scripts in bash shell, following error messages are thrown: rm:command not found On doing little investigation, I added '/bin' to $PATH and on doing echo... (9 Replies)
Discussion started by: a1_win
9 Replies

4. Shell Programming and Scripting

How to call a bash command from within a perl script?

In a bash script, one can call a perl command in the following manner, where "myperlcommand" is a perl command. perl -e 'myperlcommand(arguments)' perl -e 'print("UUUU"x4)' Now, how can one call a bash command from within a perl script? (Suppose that mybashcommand is a bash... (1 Reply)
Discussion started by: LessNux
1 Replies

5. Shell Programming and Scripting

Passing arguments from a bash shell script to a command

I'm pretty new to bash scripting and I've found myself writing things like this (and the same with even more nesting): if $CATEGORIES; then if $LABEL_SLOTS; then $pyth "$wd/texify_grammar.py" "$input" "$texfile" "--label-slots" "--categories" "$CATEGORY_LIST" ... (9 Replies)
Discussion started by: burbly
9 Replies

6. Shell Programming and Scripting

Python call to bash script returns empty string

Hi all, I need help figuring out why my script won't work when envoked from web interface. First off, I'm fairly new to Linux and Shell scripting so, my apologies for being ignorant! So I have a python script that I envoke through a web interface. This script envokes my shell script and... (8 Replies)
Discussion started by: arod291
8 Replies

7. Shell Programming and Scripting

[Solved] Unable to call a python script from bash

Hi, I am trying to run a python script embedded in bash script. But is throwing me an error. Please help. Script: #!/bin/bash nohup /usr/bin/python /opt/web/http.py & Error: /usr/bin/python: can't open file '/opt/web/http.py': No such file or directory Please help me on this. (6 Replies)
Discussion started by: maddy26615
6 Replies

8. 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

9. Shell Programming and Scripting

Beginner here, how to call a bash-script from python properly?

Hi everyone, i have the following script.sh: foo='lsusb | grep Webcam | cut -c16-18' sudo /home/user/public/usbreset /dev/bus/usb/001/$foo when i try to call this script from python using subprocess.call("script.sh", shell=True) it seems that only 'sudo /home/user/public/usbreset' is being... (6 Replies)
Discussion started by: hilfemir
6 Replies

10. Shell Programming and Scripting

How to enable rh-python34 from bash shell script, default python is 2.6 version.?

On our server default python version is 2.6, how to enable rh-python34 via bash shell. Thanks a lot for the helpful info. (7 Replies)
Discussion started by: cplusplus1
7 Replies
scl(1)							      General Commands Manual							    scl(1)

NAME
scl - Setup and run software from Software Collection environment SYNOPSIS
scl <action> <collection1> [<collection2> ...] <command> scl <action> <collection1> [<collection2> ...] -- <command> scl {-l|--list} [<collection1> <collection2> ...] DESCRIPTION
This manual page documents scl, a program which is an utility for running software packaged as a Software Collection. scl utility allows to execute an application which is not located in the filesystem root hierarchy but is present in an alternative loca- tion. This application can still use and benefit from software installed in the root filesystem. In order to let an application be visible to the system one has to use scl utility as an interface. <action> is a script name to execute in a bash environment before the application itself takes in executed. Currently only enable scriptlet is mandatory which is needed to update search paths, etc. One can enable more Software Collections if needed and therefore one can use multiple collections which are enabled by the left-right order as present on scl command-line. <command> is an arbitrary command or set of commands to execute within the Software Collection environment enabled. Control is returned back to the caller with the original environment as soon as the command finishes. If <command> is '-' (dash) then it is read from the stan- dard input. Note: if you use <command> consisting of multiple arguments, you either need to use quotes or the -- command separator. Everything that follows the separator will be considered a command or its argument. Note: some commands modify user environment in some way. Those commands may potentially break SCLs, as their activation also usually depends on env. modification as well. Typical examples of such commands are su and sudo. Every collection modifies the environment differ- ently, thus more details may be found in the documentation of the particular collection. OPTIONS
-l, --list Lists all installed Software Collections on the system. -l, --list <collection1> <collection2> ... If a collection name is specified then list of installed packages belonging to the collection is listed. EXAMPLES
scl enable example 'less --version' runs command 'less --version' in the environment with collection 'example' enabled scl enable foo bar bash runs bash instance with foo and bar Software Collections enabled cat my_command | scl enable baz - run set of commands listed in my_command file in the environment with baz Software Collection enabled scl -l list all installed collections scl -l example list all packages within example collection AUTHOR
scl was written by Jindrich Novy <jnovy@redhat.com> and Jan Zeleny <jzeleny@redhat.com> scl(1)
All times are GMT -4. The time now is 11:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy