10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to help to work this
Print everything between 2 patterns if grep is not found the search word
example
Detroit
orange
cat
bat
rat
apple
sed -n "/Detroit,/apple/p" d |grep chicago
output would be
Detroit
orange
cat
bat
rat (1 Reply)
Discussion started by: jhonnyrip
1 Replies
2. Shell Programming and Scripting
Hi, I have a control file which will contain all filenames(300) files. Loop through all the file names in the control files and check the existence of this file in another directory(same server). I need to infinitely(2 hrs) run this while loop until all the files are found. Once a file is found,... (5 Replies)
Discussion started by: laknar
5 Replies
3. Shell Programming and Scripting
bash or c-shell On Solaris 10
I need a command that will list the files of a directory, and grep each of those filenames out of a static text file, and then only echo field 2 of the static text file.
Something like this:
#> ls -1 /home/dir/ | each filename grep $filename static.txt |awk... (4 Replies)
Discussion started by: ajp7701
4 Replies
4. Shell Programming and Scripting
Hi,
I need to find all rows in 1st col of one file in another file (first occurrence) and replace the 1st col of first file with the grep result (the entire line). For example search AA from file 1 in file 2 and replace in file 1 by entire line found.
File1
AA BB CC DD
BB AA CC DDFile2
... (2 Replies)
Discussion started by: ritakadm
2 Replies
5. Shell Programming and Scripting
for XmlFileName in ${xmlFileNames}
do
XmlFileName=$(echo $XmlFileName | sed 's|./||') # Remove leading ./ path that find command prefixes to filenames
cp $XmlFileName $NEW_DIR/
done (1 Reply)
Discussion started by: emc^24sho
1 Replies
6. Shell Programming and Scripting
Hi,
running below korn shell script
#!/bin/ksh
chk_dump()
{
CNT=`ls *.dmp|grep $DATE|wc -l`
if ; then
echo "delete_dumpfile"
else
echo "start_exp"
fi
}
chk_dump
getting below error: (3 Replies)
Discussion started by: milink
3 Replies
7. Shell Programming and Scripting
Hi,
I want to grep a string from the list of files present in a text file.
I want the output to be printed only when the string is present in a file along with the file name..
I tried some thing like
cat files_list | grep "search_string" $_
I know $_ is wrong but i want something... (7 Replies)
Discussion started by: nigas
7 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Here is the question:
Make a list of files in your home directory that were changed less that 10 hours ago,... (3 Replies)
Discussion started by: fight4love
3 Replies
9. Shell Programming and Scripting
I have ASCII files to parse that 48 hours old or more ; I can identify them like so
find . -name "FILE*TXT" -mtime +1 -exec ls -ltas '{}' ';'
Some files have a list of hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to... (3 Replies)
Discussion started by: alan
3 Replies
10. UNIX for Dummies Questions & Answers
how can i list all files in my home directory that have a 4 digit id number, the line number where the id is located and the id itself not printing the entire line? (5 Replies)
Discussion started by: hobiwhenuknowme
5 Replies