Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
I ran your embedded sed command:
where <file> contained:
and I received the error message:
which, upon inspection, I expected, because the sed command looked incorrect to me.
On a system like:
Have you ever run your sed command outside of the python code?
Note that I have supplied the information regarding the environment in which I ran this code. We encourage you to do the same.
Yes, outside python code it works fine.
And inside python code I see the entire command is printed as output and the command is not getting executed as in the follwoing ---------- Post updated at 01:20 PM ---------- Previous update was at 01:13 PM ----------
And outside python, this format command worked fine
My issue :
I am getting only last command output data in ouput file. Though comamnd "print(output)" displays data for all 3rd column values but the data saved in file is not what required it hs to be the same which is being printed by command"print(output)".
Could you please help me to fix this,... (0 Replies)
Hi all...
As you know I like making code backwards compatible for as many platforms as possible.
This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)
I have a list as follows:
From this i need to grep the element using keyword as "primary" and return output as
12:13-internet-wifi-primary
i used as follows
if (i <= (len(system_info))):
ss = system_info
print... (5 Replies)
I want to run commands inside a bash script.
An example is
I want to pass the command in a string as regexp as an argument to the script, then run sed on the bash variable
sed.sh regexp
sed.sh "-i \"s/<p>//g\""
then call
sed "$regexp" $fl (3 Replies)
Hi Geeks,
I have the following python script.
#!/usr/bin/python
#Script to pull KPI values from MMEs.
import paramiko
import sys
import os
host = sys.argv
user = sys.argv
password = sys.argv
ssh = paramiko.SSHClient() (8 Replies)
I need to compare the output files in a directory for sftp, looking through a mask.
Return the full file name.
Eg.
I have a file named locally:
test.txt
I must check through sftp, if a file with the following name:
test_F060514_H173148.TXT
My idea is for the filename to a... (0 Replies)
Hi,
I am a bit confused ,why would a sed command work fine outside of ksh script but not inside.
e.g
I want to replace all the characters which end with a value and have space at end of it.
so my command for it is :
sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name
This is working fine in... (8 Replies)
Hello,
The following sed command is giving error
sed: -e expression #1, char 13: unknown option to `s'
The sed command is
echo "//-----" | sed "s/\/\/---*/$parChk/g"
where parChk="//---ee-"
How can i print the variable value from sed command ?
And is it possible to replace a... (2 Replies)
I am using script
S_db=`grep SRC_DB= ${login_txt} | cut -d= -f2`
T_db=`grep TGT_DB= ${login_txt} | cut -d= -f2`
today=`date +%Y%m%d`
sed 's/USER_WORK/RAR_WORK_D1/g' < ${my_path}/files/${T_target}_${today}_DDL.txt > ${my_path}/files/temp9
But when I am trying to remove hardcode values... (1 Reply)