Search Results

Search: Posts Made By: mharley
20,675
Posted By mharley
Pausing a Grep output
I am writing a small script which allows users to grep multiple log files across multiple directories, and often the output produced by the grep statements is quite lengthy. It would be nice if the...
15,849
Posted By mharley
What I would ideally like to do is perform a grep...
What I would ideally like to do is perform a grep on all of the files, and if any of the search parameters are found, output both the filename and the line containing the parameter found. This is...
15,849
Posted By mharley
Grep all files matching partial filename
What would be the easiest way to grep all files within a particular directory that match a partial filename? For example, searching all files that begin with "filename.txt" and are appended with the...
2,904
Posted By mharley
Referencing variables in commands
The script I am writing must be able to run several commands (tar, gzip etc) on filenames that are supplied by variables. I am unsure as to what syntax is required/ideal when referencing variables...
2,498
Posted By mharley
Is this a valid statement?
I need an if statement that recognizes whether files fitting a certain pattern exist in the current directory. Is this syntax valid:

if [ -f "filename.ext.${zero}${star}" ]; then
...
fi
...
10,767
Posted By mharley
Update
Ok, thanks to all of your help, I have solved many of the problems I was having. I have encountered a new problem, however, that needs dealing with. Is it possible to verify the existance of files...
10,767
Posted By mharley
Troubleshooting Script
I am fairly new to Unix (Sun OS) scripting with Ksh, and I could use a little help troubleshooting my script. When I run it, I get the error "if unexpected" on the function setYear. If I comment...
3,503
Posted By mharley
When I take out those spaces, the error I get is...
When I take out those spaces, the error I get is "[0: not found". And then it still proceeds to echo "0".
3,503
Posted By mharley
I've actually tried that, with no success. The...
I've actually tried that, with no success. The error I get is "dateMonth: not found". It then proceeds to echo "0".
3,503
Posted By mharley
What's wrong with this simple statement?
I know that this is a ridiculously simple statement, but I am getting an error when I execute it, and I can't figure out what it is. Can anyone point me in the right direction?


#!/bin/ksh...
19,261
Posted By mharley
Ya, I noticed that just after I posted the...
Ya, I noticed that just after I posted the question. Sorry, my bad. :confused:
19,261
Posted By mharley
Date Subtraction in KSH
I need to figure out the numeric representation of the previous month (in an automated monthly-running script) so that I may append it to a filename. I have tried statements such as variable=`date...
1,945
Posted By mharley
This is the script that I have written so far. ...
This is the script that I have written so far. It does not include any code for writing the messages to the temp file, or any code for sending the email.


#!/bin/ksh

DATEmonth='date +%m'...
1,945
Posted By mharley
Newbie Questions
I am relatively new to both KSH and Unix scripting, and I would like some help getting my script up and running. I would like to have the script attempt various commands (tar, copy, gzip etc) and...
Showing results 1 to 14 of 14

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