Jan-23-2020, 05:13 PM
i am need to python coding. Just wrote code to filter the first column of pvs output and redirect to one file.
below is my code .while running i am getting error variable value not giving output
from sys import stdin
import os
import sys
import subprocess
import shutil
import datetime
#import commands
today = datetime.datetime.today()
global vgname
vgname=raw_input("enter the vgname: ")
cmd='(pvs | grep + vgname) | (awk \'{print $1}\') > sel.txt'
os.system(cmd)
[root@localhost Python-3.6.3]# python rack.py
enter the vgname: vg01
grep: vgname: No such file or directory
[root@localhost Python-3.6.3]#
Some one please help me to fix this
below is my code .while running i am getting error variable value not giving output
from sys import stdin
import os
import sys
import subprocess
import shutil
import datetime
#import commands
today = datetime.datetime.today()
global vgname
vgname=raw_input("enter the vgname: ")
cmd='(pvs | grep + vgname) | (awk \'{print $1}\') > sel.txt'
os.system(cmd)
[root@localhost Python-3.6.3]# python rack.py
enter the vgname: vg01
grep: vgname: No such file or directory
[root@localhost Python-3.6.3]#
Some one please help me to fix this