Bash script to send lines of file to new file based on Regex
I have a file that looks like this:
What I want to do is make three new files with just those selections. So the three lowercase lines under CORP-CRASHTEST-BU would output to another file, then CORP-TEST would also output the following three lowercase lines to another file. I have tried to use arrays, but if I have to provide numbers to identify the arrays it would be hard since it is not just the file above but other files that I want to perform this operation on. I need a a script that would send anything underneath a line that contains capital letters to another file. If anyone has a suggestion on how to start on this, it would be appreciated. I have not started on it yet, so I'm just asking for a general idea.
I have been working on a script to list all the name's of a subfolder in a text file then edit that text file and then delete the subfolder base on the edited text file so far I have been able to do every thing I just talked about but can't figure out how to delete the subfolers base on a text file... (8 Replies)
I need help.....I have number of data files and I need to read the contains of each file which is three lines by awk commands or script, and send each line within the data file to different new file . That means I will have three files as a result, the first file will contains the first lines for... (4 Replies)
Hello,
I try to script something (bash-script) and can not find a way to get and store a match into a variable from a line in a file. grep isn't useful as the matches are not returned - just colored. I can't get 'expr' to work for me. Is it necessary to use a perl-script with regex instead?
... (7 Replies)
Hi All,
I am very new to UNIX and I have tried this for a longtime now and unable to crack it....
There is a file that is continuously updating. I need to search for the string and find the date @ which it updated every day.....
eg:
String is "work started"
The log entry is as below:
... (1 Reply)
Hi,
I need help with this-
input.txt :
L B white
X Y white
A B brown
M Y black
Read this input file and if 3rd column is "white", then add specific lines to another file insert.txt.
If 3rd column is brown, add different set of lines to insert.txt, and so on.
For example, the given... (6 Replies)
I'm working on a new exercise that calls for a script that will take in two arguments on the command line (representing the range of line numbers) and will subsequently print those lines from a a specified file. Command line would look like this: ./lines_script.bash 5 15 <file.txt. The script would... (8 Replies)
In the below bash a file is downloaded when the program is opened and then that file is searched based on user input and the result is written to a new file.
For example, the bash is opened and the download.txt is downloaded, the user then enters the id (NA04520). The id is used to search... (5 Replies)
In the below bash I am trying to copy the only text file (always only one) in /home/cmccabe/Desktop/list/QC/metrics.txt and rename each of the 3 text files according to /home/cmccabe/Desktop/test/list.txt using lines 3, 4 ,5. This format (that is list.txt) is always 5 lines. Thank you :).
... (12 Replies)
Hey, im fairly new to unix and Im trying to make this unix project that would display a menu and do the following.
MENU
===========================
(p, P) Print users info
(a, A) Add new user
(s, S) Search user
(d, D) Delete user
(x,X) Exit
Enter your choice:
Trying to... (3 Replies)
Discussion started by: ultimaxtrd
3 Replies
LEARN ABOUT X11R4
idmap_ad
IDMAP_AD(8) System Administration tools IDMAP_AD(8)NAME
idmap_ad - Samba's idmap_ad Backend for Winbind
DESCRIPTION
The idmap_ad plugin provides a way for Winbind to read id mappings from an AD server that uses RFC2307/SFU schema extensions. This module
implements only the "idmap" API, and is READONLY. Mappings must be provided in advance by the administrator by adding the
posixAccount/posixGroup classes and relative attribute/value pairs to the user and group objects in the AD.
IDMAP OPTIONS
range = low - high
Defines the available matching UID and GID range for which the backend is authoritative. Note that the range acts as a filter. If
specified any UID or GID stored in AD that fall outside the range is ignored and the corresponding map is discarded. It is intended as
a way to avoid accidental UID/GID overlaps between local and remotely defined IDs.
schema_mode = <rfc2307 | sfu >
Defines the schema that idmap_ad should use when querying Active Directory regarding user and group information. This can be either the
RFC2307 schema support included in Windows 2003 R2 or the Service for Unix (SFU) schema.
EXAMPLES
The following example shows how to retrieve idmappings from our principal and trusted AD domains. If trusted domains are present id
conflicts must be resolved beforehand, there is no guarantee on the order conflicting mappings would be resolved at this point. This
example also shows how to leave a small non conflicting range for local id allocation that may be used in internal backends like BUILTIN.
[global]
idmap backend = tdb
idmap uid = 1000000-1999999
idmap gid = 1000000-1999999
idmap config CORP : backend = ad
idmap config CORP : range = 1000-999999
AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open
Source project similar to the way the Linux kernel is developed.
Samba 3.5 06/18/2010 IDMAP_AD(8)