0
votes
1answer
103 views

How to replace an exact matching word using gsub

Please see the below script - On this nawk 'NR==FNR { a[$1]=$2 ; next} {for ( i in a) gsub(i,a[i])}1' file.dat 1.txt 1.txt ioiufeioru dfoiduf MO_CIF_INP438 fjkdj MO_CIF_INP dsjhdf BP_LINKED_TETES ...
-1
votes
2answers
63 views

how to find number of substrings between delimiter? [closed]

I have the string following something(1)^^^something(2)^^^something(3)^^^ ... ^^^something(n) how to find number of something(s) in the string.
4
votes
1answer
1k views

How do I parse file paths separated by a space in a string?

Background: I am working in Automator on a wrapper to a command line utility. I need a way to separate an arbitrary number of file paths delimited by a single space from a single string, so that I may ...
1
vote
1answer
359 views

How to calculate and group the time differences of specified syscalls when running strace

I'm planing to do some web performance testing (to see how much time it's spent for each file), but it could be useful for any application. I exactly know existence and how to use different ...
0
votes
2answers
161 views

Generate new file with specific structure from text file

On Linux I have the file orig-file.txt. This file include 4 fields now, but they could be less or more (this file is generated by other application). What is the best option to translate the ...
0
votes
1answer
309 views

usermod + awk invalid syntax

I have been trying to write a command (Solaris server) that adds a user to a specific group. It's a pretty long command so I'll post the whole command here and then break it down. USER=myUser ...
2
votes
2answers
2k views

awk match whole word

I want to use awk to match whole words from text file. Including words bounded by non alphanumeric characters. For example - string to search for - ABC Source file - HHHABCCCCH HHH ABC ...
1
vote
2answers
645 views

File name with spaces piped to two xargs commands

I have a directory and many more subdirectories like the following - file with spaces.txt filewithsuperlonglines.txt ordinaryfile.txt binaryfile.bin The command - find . -type f -print0 | ...
2
votes
2answers
158 views

determine start of file when passing multipe files to awk

I have a shell script like the following - find "." "Account" -maxdepth 1 -name "*.aspx" | xargs awk -f get_controls.awk It passes multiple files to an awk script BEGIN{ FS="\"" } ... ...
1
vote
2answers
1k views

Shell: Find and replace word

I have a string in my shell script which is in a fixed format : '[STATUS REPORT] PROJECT'. When user executes my shell script he will be asked to provide a value for 'PROJECT'. I would like to ...
1
vote
3answers
2k views

Passing a shell script variable into an AWK command

I want to be able to call a shell script contining the following command. awk -F $'\xE7' '{OFS ="¬"} { $3 = sprintf("%010s". $3) ; print $0 }' > outputfile But I want to be able to pass a shell ...