sbc_compliant: (Default)
[personal profile] sbc_compliant
So, I had a list of items upon which I wanted to run a command.

The command required 2 arguments:
a) the list item and
b) the list item modified by a character substitution

I finally figured out how to mod the variable, and feed it in to my command, thusly:

for item in `cat list.txt`; do command `echo $item | sed 's/char1/char2/'` $item; done


Hooray sed!



p.s. Yes, I only needed the first instance of char1 on the line replaced. That's why I didn't use the trailing g in the sed replacement.

Profile

sbc_compliant: (Default)
sbc_compliant

November 2019

S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 10th, 2026 06:35 am
Powered by Dreamwidth Studios