Skip to content
Advertisement

Tag: shell

How to pass “-L” to an awk script?

I am trying to write an awk script that accepts -L as an argument. As an example to show you what I want, here is a simple awk script called awktest: If I run this from shell: I get as output: Which is what I expect. It seems to work for anything I put in except -L. If I run:

How we can use correctly pipe in Linux?

I have a project, the goal it is to extract phone numbers of a data.txt file, so I did a program. Like that : My problem is when I want to use this program and to execute on my terminal I had to use pipe for my terminal command. I tried many different commands on my terminal and the last

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

Why dd can’t handle sparse files in shell scripts? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 4 years ago. Improve this question

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

List and change directory and run command in Shell

I am coming back to shell after almost 6 years or so. I have a directory structure let’s say, MainDirectory –> subDirectory1/some.xml                      –> subDirectory2/some.xml                      …                      …                      –> subDirectoryN/some.xml And I want to execute some.xml in all the subdirectories and get the output to a file using “>” operator I guess. What would be the proper script for this? I tried

Advertisement