Python Forum
Long command with characters not working in Python on Oracle Linux 7
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Long command with characters not working in Python on Oracle Linux 7
#5
thanks I tried to change command as you suggested.

When I run python I do not get any errors. But the output is not shown.

printing the command via python I see that the command is as follows:

find /OVS -wholename *VirtualMachines/*/vm.cfg -exec grep -H simple_ {} ; 2>/dev/null | awk "{print $3}" | tr -d '

Original command is below

find /OVS -wholename '*VirtualMachines/*/vm.cfg' -exec grep -H 'simple_' {} \; 2>/dev/null | awk {'print $3'} | tr -d "'"

As we can see the \ is removing the double quotes. Without double quotes above command will not work.

Is there a way we can modify the command so that it is parsed correctly by Python and executed on remote server?
Reply


Messages In This Thread
RE: Long command with characters not working in Python on Oracle Linux 7 - by iaas_infra - Jul-18-2019, 03:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] [Linux] Run Python script through cron? Winfried 2 1,352 Oct-19-2024, 06:29 PM
Last Post: Winfried
  Conversion of Oracle PL/SQL(packages, functions, procedures) to python modules. DivyaKumar 3 8,441 Oct-01-2024, 03:32 PM
Last Post: Alex_Kirpichny
  Linux, Python, C ++, Brain2 and errors. PiotrBujakowski 0 1,062 Jun-24-2024, 03:41 PM
Last Post: PiotrBujakowski
  Is possible to run the python command to call python script on linux? cuten222 6 2,558 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  How to use a variable in linux command in python code? ilknurg 2 2,498 Mar-14-2022, 07:21 AM
Last Post: ndc85430
  Long-term stable source to get news headlines with Python? sandufi 4 3,328 Dec-23-2021, 09:48 AM
Last Post: sandufi
  How to transform from wide to long format in python shantanu97 1 2,433 Nov-21-2021, 11:53 AM
Last Post: buran
  use subprocess on linux\pi wwith a "grep " command korenron 2 11,467 Oct-19-2021, 10:52 AM
Last Post: DeaD_EyE
  Python syntax in Linux St0rmcr0w 2 66,409 Jul-29-2021, 01:40 PM
Last Post: snippsat
  Encrypting Oracle Passwords / Python Library for That? bmccollum 1 3,648 Jun-11-2021, 07:59 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020