Search Results

Search: Posts Made By: plsrn
4,910
Posted By CarloM
Don't have access to a box right now to test it,...
Don't have access to a box right now to test it, but these changes should work:

1. Change the hashbang to #!/bin/bash (on my system /bin/sh is a link to bash). Or just change the [[ to a full if....
4,910
Posted By CarloM
Well, I spent a couple of hours playing in sed...
Well, I spent a couple of hours playing in sed and couldn't find a way - but then I'm not very good with sed!

I did manage to create a solution of sorts with awk.

It uses a csv containing the...
4,910
Posted By binlib
If you insists on using sed: sed "/varx =/h ...
If you insists on using sed:
sed "/varx =/h
/vary = /{
G
s/\(.*vary = '\)[^']*\('.*\)\n.*varx = 'false'.*/\1NEW_VAL_1\2/
t # optional
s/\(.*vary = '\)[^']*\('.*\)\n.*varx =...
4,910
Posted By CarloM
I'm not sure I understand your conditions. Is the...
I'm not sure I understand your conditions. Is the ELSE ever going to be executed except at the start of the file (i.e. before we encounter the first varx assignment)?

Put another way, what output...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy