10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am using AIX and trying to search and replace a string with another string in multiple files in different directories.
I wanted to search replace in steps so I don't change all of the instance anywhere in the server at once, minimizing impact.
I first searched... (5 Replies)
Discussion started by: zaino22
2. Shell Programming and Scripting
Being a beginner in scripting I am not sure the direction to take to accomplish the below task and would love suggestions.
input file: domains.list
Read input file, search in named.conf and find domain and delete entry for the purpose of cleanup activity.
named.conf entry example
zone... (8 Replies)
Discussion started by: djzah
3. Shell Programming and Scripting
My file is a string of around 50K character.
I'm trying to insert new line after every 320 character in my file.
I know the command to insert newline, but problem is I'm not able to search 320th position.
Please advice. (6 Replies)
Discussion started by: Amit786
4. UNIX for Advanced & Expert Users
i have a file named keyword.csv(contains around 8k records) which contains a no. of columns.
The 5th column contains all the keywords.
I want to recursively search these keywords in all .pl files(around 1k) and display the filename....Afterthat i will use the filename and some of the column from... (3 Replies)
Discussion started by: millan
grep pattern filename
To search for the pattern in all files in the current directory and the sub-directories recursively, what needs to be substituted in filename? (1 Reply)
Discussion started by: ravisingh
6. Shell Programming and Scripting
how to recursively search for a list of keywords in a given directory??
suppose i have kept all the keywords in a file called "procnamelist" (in separate line)
and i have to search recursively in a directory called "target/dir"
if i am not doing recursive search then... (4 Replies)
Discussion started by: neelmani
7. Shell Programming and Scripting
I would like to export the 5th line from every file within a directory. I am using GNU sed because we have no Unix or Linux environment. I used the following statement:
sed -s -n 5p c:\directory\*.*
but I only get the 5th line from one of the files in the directory. I am desperate for a... (1 Reply)
Discussion started by: hollingv
8. Shell Programming and Scripting
I tried making a shell script which recursively search in a given directory for all files *.txt and then search and replace some text and after that
save each file as $filename.dynamips.txt
I would like to get this done with sed. I tried but couldn't get it to work.
BTW this is not... (1 Reply)
Discussion started by: 2bone
9. Shell Programming and Scripting
I'm trying to determine when the last time a file in a certain directory was modified. I don't care what file it is, I just want to know when it was last updated. So far I have
ls -aRl --full-time --sort=time
which is close. The problem is that it only sorts within folders, not... (2 Replies)
Discussion started by: lokisapocalypse
10. UNIX for Dummies Questions & Answers
What is a good way to find an entry in a .conf file and then remove all lines associated with that entry?
I have a Samba server running on Linux that I would like to easily add/remove share entries in the smb.conf file without removing or deleting lines that are not associated with that section.... (5 Replies)
Discussion started by: darthur
EXPAND(1) BSD General Commands Manual EXPAND(1)
expand, unexpand -- expand tabs to spaces, and vice versa
expand [-t tab1,tab2,...,tabn] [file ...]
unexpand [-a] [-t tab1,tab2,...,tabn] [file ...]
The expand utility processes the named files or the standard input writing the standard output with tabs changed into blanks. Backspace
characters are preserved into the output and decrement the column count for tab calculations. The expand utility is useful for pre-process-
ing character files (before sorting, looking at specific columns, etc.) that contain tabs.
The unexpand utility puts tabs back into the data from the standard input or the named files and writes the result on the standard output.
The following options are available:
-a (unexpand only) By default, only leading blanks and tabs are reconverted to maximal strings of tabs. If the -a option is given, then
tabs are inserted whenever they would compress the resultant file by replacing two or more characters.
Set tab stops at column positions tab1, tab2, ..., tabn. If only a single number is given, tab stops are set that number of column
positions apart instead of the default number of 8.
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of expand and unexpand as described in environ(7).
The expand and unexpand utilities exit 0 on success, and >0 if an error occurs.
The expand and unexpand utilities conform to IEEE Std 1003.1-2001 (``POSIX.1'').
The expand command appeared in 3.0BSD.
April 21, 2002 BSD