I'm currently writing a bash script. This bash script is installs some kind of applications. I have a manager menu for this applications. One of this application is a Music Bot. This Music Bot has some kind of permission system. If you want to add an admin you must edit a file. So I did a system for remembering old admins. It just prints admins to the file called admins. The numbers you saw is admin numbers. If you want to add multiple admins, then you have to seperate numbers with ",".
I'm currently writing a bash script. This bash script should check if the exact string 329, exists in myfile. I have searched through the web and found some answers, but I can't use -x parameters because I have more numbers than 329, on myfile. And without the -x parameter, I can get the Exists r...
I was able to manage adding admins but now is the problem removing. For removing you must specify the "," so I can just remove it by sed. Otherwise it just brokes
Thats why I need it
I was gonna do if the grep output is "Exists" then remove it with "," else remove it normally
Its just an example, every users admin is different in the app. Mine is 329 and I added it last. Thats why it doesn't have "," character. But for some people it might have "," character.
1. Replacing all occurrences of one string with another in all files in the current directory:
These are for cases where you know that the directory contains only regular files and that you want to process all non-hidden files. If that is not the case, use the approaches in 2.
All sed solutions ...
@user1614432 I feel like a little bit of the config file for reference might make it easier
I tend to follow "this is what I have (config file), this is what I get (current way I am trying and the outout) and 'this is what I need' for questions like this
Please post a new question and make sure to include i) an example input file with lines that should be changed and some lines that should not be changed and ii) the output you expect. I need to run now so I can't help here.