Skip to content
Advertisement

Tag: unix

how to remove “^@” from text files in unix?

I am trying to remove “^@” from multiple text files using Unix platform. I have already found this solution, but it does not work for my case. I also used sed -i -e ‘s/^@//g’ testfile.txt and dos2unix testfile.txt. sample data are put here. Any suggestion would be appreciated. Answer The ^@ that you’re seeing isn’t a literal string. It’s an

Unix – Replace column value inside while loop

I have comma separated (sometimes tab) text file as below: parameters.txt: with below code I try to loop through the file and do something I wanted to update the last column of the file to N if the above operation is successful, however below approaches are not working for me: sed ‘s/$f5/N/’ ‘$5==”Y”,$5=N;{print}’ $(echo “$line” | awk ‘$5=N’) Update: Few

IF statement for different lines [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago. Improve this question Question is simple, but I can’t find a fast and elegant way to solve. I want to decide next: if block size of files is

Search and Replace ( multiple lines )

Hello StackOverflow Community! I’m working on a bash script to change in Dynamic text file, I want to replace multiple lines with one line. Ex: This example, I want to replace THIS With KKKKK Before script After script I found a script to replace using ( sed ) but it doesn’t replace multiple lines. NOTE: I’m a beginner at scripting

Replace string pattern with a string in linux file [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question I am a newbie to Linux. Need to replace With using sed or some alternative. Answer Command that given desired

why my unix domain socket can’t work

there are two simple program to demo the unix domain DGRAM socket. and the following is the result: it seems like nothing wrong here. but, I get nothing from the server. I don’t know why it can’t run as I expect. Answer You should be sending to /var/run/lsvr.sock not to /var/run/lcli.sock. Also you don’t have to bind in client so

Advertisement