Search Results

Search: Posts Made By: daveaasmith
12,313
Posted By daveaasmith
Is it possible to display alongside the filename,...
Is it possible to display alongside the filename, the entry within the Pattern.txt file it's has matched against ?
12,313
Posted By daveaasmith
Perfect - that works a treat!
Perfect - that works a treat!
12,313
Posted By daveaasmith
File find | xargs grep for pattern file
Folks

I've been struggling this with for far too liong now and need your help!

I've been happily using grep for a search of a directory, to list the files which contain a string:

find ....
11,163
Posted By daveaasmith
Thanks for your reply folks! This script is...
Thanks for your reply folks!

This script is on a UNIX server, using ksh93.

It's a script which has been around for ages, not written by me (not that I'm trying to avoid blame!) and has...
11,163
Posted By daveaasmith
Interesting, as I have amended to...... ...
Interesting, as I have amended to......

LINES=`wc -l $FILE3 | awk '{printf("%d\n",$1);}'`
......and still get the same error.

I have also tried......

LINES=`wc -l < "$FILE3"`

......and...
11,163
Posted By daveaasmith
Script - Expression not complete more tokens expected
I have the following script to output a report of response times - but it is throwing the error:


./jobname[46]: -: 0403-053 Expression is not complete; more tokens expected.


Here is the...
11,222
Posted By daveaasmith
Using GREP for special characters
Hi folks

I am issuing the following command:

grep "[\/:*?"<>|#+%&]" *

Looking for the characters \/:*?"<>|#+%& within all files in a directory, but the command fails being unhappy with pipe:...
8,251
Posted By daveaasmith
Have tried with both " or ' around the *.bak*,...
Have tried with both " or ' around the *.bak*, but get the error message each time:

find . -name -type f '*.bak*' -exec tar -cvf MigrationBAKFiles.tar {} \;

find: 0652-009 There is a missing...
8,251
Posted By daveaasmith
thanks bsddaemon, but does this move/copy the...
thanks bsddaemon, but does this move/copy the files into the tar ?
8,251
Posted By daveaasmith
Tar everything matching a pattern
What's the best way to copy (and after I've confirmed it works ok, move) all files matching *.bak* (within an entire directory structure) into a single tar file?

This is what I want to achieve,...
3,092
Posted By daveaasmith
Get string from file after nth symbol
I've got a file, where I want to grab two fields from it. The file isn't fixed format, so all I know is that the two fields are after a certain number of delimiters within the record.

File e.g....
10,330
Posted By daveaasmith
I am currently using the following query to print...
I am currently using the following query to print the lines AFTER a pattern:

awk '/Statement Execution Time/{c=10}c&&c--'

Can this be adapted to print the lines after a pattern, up to a second...
10,330
Posted By daveaasmith
Actually, I tried the following:- awk...
Actually, I tried the following:-

awk 'c&&c--;/query/{c=2}' inputfilename

and it worked fine for me!
10,330
Posted By daveaasmith
Script to find string and return next 2 lines
I am trying to create a script to search for a string within a file, and if found, return the next two lines.

Example file:-

msj
mh
query
return this 1
return this 2
mjk
mhj
query...
20,336
Posted By daveaasmith
Nice one folks. I have added the missing...
Nice one folks. I have added the missing backticks (didn't realise these were also required, rather than the double quotes replacing them). I had indeed cut/pasted into this thread incorrectly...
20,336
Posted By daveaasmith
Have to admit to not following what you've coded...
Have to admit to not following what you've coded above, so have stuck to the original, trying to "properly double-quote the backticks" - as follows.

for files in $icofile
do
if [...
20,336
Posted By daveaasmith
I've coded as follows, as I don't know the name...
I've coded as follows, as I don't know the name of my file (only the prefix), and also there may be mulitple files. I need to check all the files for '70' before I continue processing. I get the...
20,336
Posted By daveaasmith
Read last line of file to check for value
Folks

How best to read the last line of a file, to check for a particular value?

This is the last line of my file......

00000870000002000008 0000000020000

......I need to check that this...
7,991
Posted By daveaasmith
FTP - switching user syntax
Running the following shell script,

#!/usr/bin/ksh
set -x
swdofile=/opt/SWDO_IN1V01P001_1.csv
USER='myusername'
PASSWD='mypassword'
HOST='myhostname'
ftp -n $HOST << SCRIPT
quote USER $USER...
Showing results 1 to 19 of 19

 
All times are GMT -4. The time now is 04:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy