DavidScott612

Oregon

long time developer of C, C++. Some flavors of basic/VB, and various python, and java. Somewhat newbie in the Linux world.

Oct
7
comment difficult string to replace in script using SED
got it figured out. your suggestions were very helpful!
Oct
7
revised difficult string to replace in script using SED
added 126 characters in body
Oct
7
accepted difficult string to replace in script using SED
Oct
7
revised difficult string to replace in script using SED
deleted 259 characters in body
Oct
7
revised difficult string to replace in script using SED
added 360 characters in body
Oct
7
comment difficult string to replace in script using SED
That 3rd example you give does not work either. If I use the read. *BOOTxxx I get a syntax error. " sed: -e expression #1, char 11: extra characters after command"
Oct
7
awarded Autobiographer
Oct
7
comment difficult string to replace in script using SED
yes I should note, this string pattern appears 5 times within the script with only slight variances in the strings. ie. asking the user for different file path input, and assigning the input to a different variable.
Oct
7
comment difficult string to replace in script using SED
Actually, the script that I will be acting upon has 5 instances of this string pattern in it, with only slight variations in the prompt phrase, and the path variable name. so this is why I chose to use the entire string line.
Oct
7
comment difficult string to replace in script using SED
@ Jonathan. OK I tried your first example you gave. It executes without error, creates the "newfile". However the newfile is no different from the old. That input string is still in there. What am I missing here?
Oct
7
comment difficult string to replace in script using SED
@ Jonathan. This is a great start! thanks! I tried your examples, and it does not error out, however, the output file that got edited is blank! What do you supposed I did wrong here?
Oct
7
comment difficult string to replace in script using SED
@ Barmer. Yes we need to automate this because there are 5 questions like this in the script. The script is part of an installer from a supplier, which we can not edit permanently, so I must edit on the fly. Secondly we found that the users keep making typoing these long strings during the install process.
Oct
7
asked difficult string to replace in script using SED
Nov
28
awarded Nice Question
Nov
27
awarded Supporter
Nov
27
comment Is there a better way to write this "if" boolean evaluation?
Ah of course! It is now obvious to me! for some reason I had it in my head I must evaluate between the number with the AND statement. Thanks for the clarification. Ideally, I would have used a switch/case statement if I was using c++. Much cleaner. So goes it. I will check out the link.
Nov
27
accepted Is there a better way to write this "if" boolean evaluation?
Nov
27
comment Is there a better way to write this "if" boolean evaluation?
Ah that is an interesting tidbit I did not know about Pyhton. thanks!
Nov
27
asked Is there a better way to write this "if" boolean evaluation?
Aug
3
comment Persist browser client javascript/HTML data without cookies
one last thing.... there is probably a cleaner way to do what I did but with less code, but I did not know how. If someone who knows wants to provide this... great!
1 2 3