10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Good day guys,
I'm having trouble in creating a logic when it comes to replacing the values inside a file.
I tried using sed command but it just doesn't work the way I want it to be.
Here is what I'm trying to achieve.
If my input file contains the values below.
NAME++GUEST1 ++GUESS2++... (3 Replies)
Discussion started by: asdfghjkl
3 Replies
2. Shell Programming and Scripting
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)
Discussion started by: Kangol
3 Replies
3. UNIX for Advanced & Expert Users
File lalo.txt contains: Á
I need to replace Á by A using sed command.
od -x lalo.txt
0000000 c10a
0000002
sed -e 's/\xc1\x0a/A/g' lalo.txt > lalo2.txt
Also tried:
sed -e 's/\xc3\x81/A/g' lalo.txt > lalo2.txt
Output file lalo2.txt still has Á
Unix version: SunOS 5.11 ... (9 Replies)
Discussion started by: mrreds
9 Replies
4. Shell Programming and Scripting
Hi
I am trying to execute a sed command inside paramiko which finds and deletes the particular string from a file
But sed command doesnt work inside paramiko python
machine=qwe
dssh = paramiko.SSHClient()
dssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
... (4 Replies)
Discussion started by: Priya Amaresh
4 Replies
5. Shell Programming and Scripting
Hi
i have a 2 files say test1 and test2 with the following data.
cat file
test
test1
i want to append the output from a awk one liner to both the files.
for i in cat file;do awk '/
whats happening is its printing the output properly. but not appending the way it showing in print... (1 Reply)
Discussion started by: venkitesh
1 Replies
6. Shell Programming and Scripting
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)
Discussion started by: vital_parsley
8 Replies
7. Shell Programming and Scripting
Hi,
Taking sum up all values inside the file by using the below command:
paste -sd+ filenmae | bc
Getting some error like "0705-001: building space exceeded on line1 stdin"
The original data looks like
SPACE SPACE SPACE 0.123 JOBNAME1
SPACE SPACE 20.325 JOBNAME2
SPACE SPACE... (2 Replies)
Discussion started by: NareshN
2 Replies
8. Shell Programming and Scripting
Hi,
Could someone please help me with this? I have a text file that has fields seperated by comma. The last column in it has multiple values seperated by "|". I need to sort values in the last column seperated by pipe..is there any way I can do this through script?
Sample text file -
... (7 Replies)
Discussion started by: sncoupons
7 Replies
9. Shell Programming and Scripting
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)
Discussion started by: frozensmilz
2 Replies
10. UNIX for Advanced & Expert Users
I have a code as follows
awk ' BEGIN{FS=OFS=","}
{
n=split($3,a1,"~")
split($4,a2,"~")
split($5,a3,"~")
for(i=1;i<=n;i++) {
print $1,$2,a1,a2,a3,date
}
}' file
In the above code I need to add current date(date). How is this possible to call an date or a exported value... (13 Replies)
Discussion started by: tkbharani
13 Replies