Search Results

Search: Posts Made By: wbport
2,572
Posted By wbport
No problem if only one remote site. In our shop...
No problem if only one remote site. In our shop we had to check a number of remote sites so we checked all of them then looked at the log to see if there was a problem.
2,572
Posted By wbport
At one time we had to check a number of branches....
At one time we had to check a number of branches. The following code shows the "ping" as run in a "do" loop followed by the "sed" control file. Run sed with the -n option and "p" something...
1,259
Posted By wbport
You might want to use sed instead. Once you find...
You might want to use sed instead. Once you find STANDALONE, you can append the next line and look at it. This is an example of what your sed control file should look like:

/STANDALONE/ {
...
1,299
Posted By wbport
Finding records NOT on another file
I have three files named ALL, MATCH, and DIFF. Match and diff have completely different records included in the "all" file, but the "all" file also has records not in either the Match or Diff files....
1,172
Posted By wbport
I couldn't find "-fF" in my Unix books or "man...
I couldn't find "-fF" in my Unix books or "man grep", but putting up to three "-ve" reduces the number of times I have to run it by nearly a third. Also runs faster.

Thank you, gentlemen.

I've...
1,172
Posted By wbport
String of exclusions failed.
We are in a conversion where a list of six digit numbers needs to be excluded from an existing report. As new ones are added we have an ever longer string of "grep -v" commands like:
grep -v...
864
Posted By wbport
If this is to be part of a script that will do...
If this is to be part of a script that will do different things depending on whether or not a pipe is found, you might want to add a -q to the command line when you no longer need to see its active. ...
1,502
Posted By wbport
This is in an exec script: ping -c 1 $othsys...
This is in an exec script:
ping -c 1 $othsys >>logfile.txt 2>&1That logfile is run through sed -n -f with the following control file for sed:
# File name ping.sed
/ ping statistics / {
...
2,367
Posted By wbport
It looks like the first thing you would do would...
It looks like the first thing you would do would be the tail command to get the last line, piping the result to a grep or sed. You can then check the return code to see if you found what you needed...
3,109
Posted By wbport
I have that book, it's name is sed & awk and I...
I have that book, it's name is sed & awk and I also found it to be an excellent primer.

The symbol he is looking for represents Queenside Castling.

If you need to create a diagram from a point...
797
Posted By wbport
If you want to try sed, run this command after...
If you want to try sed, run this command after you have identified the line.
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
661
Posted By wbport
This is a sed control file we use to report no...
This is a sed control file we use to report no return after doing a ping to a number of remote computers. Run this file after specifying sed -n -f following_code log_of_pings .
/ ping statistics /...
1,865
Posted By wbport
I see if your 1234 line is followed by a 1123...
I see if your 1234 line is followed by a 1123 line you don't want to combine lines. For the following I assume your data will never have a tilde character "~". If it does substitute some other...
1,865
Posted By wbport
Try putting the following code into a command...
Try putting the following code into a command file for sed:
/^1234/ {
N
s/\n/ /
}
How to use it: sed -f commandFile inputFile > outputFile

Once a line starting with...
2,002
Posted By wbport
diff reports differences between two files and...
diff reports differences between two files and what has to happen to change the first file into the second. If a record appears in the first file but not the second, diff reports the line(s) on the...
2,002
Posted By wbport
You don't need to change the original files, but...
You don't need to change the original files, but you can do whatever is needed to your own work files.

You were getting close by breaking many numbers on one line to one per line. From there,...
1,339
Posted By wbport
If you have the same number of lines in each file...
If you have the same number of lines in each file and have the same number of lines in each corresponding definition, paste can create them on the same line, i.e. it creates one record with line n...
1,339
Posted By wbport
Could the paste command work here?
Could the paste command work here?
832
Posted By wbport
Just enclosed $cmdname in double quotes and it...
Just enclosed $cmdname in double quotes and it worked!

Many thanks!
832
Posted By wbport
This morning I tried it again with "ls -l...
This morning I tried it again with "ls -l /dir1/dir2/FILEONE*" and that shows up at the top of the log. If I sent it to bb123456, what comes back is ls: /dir/dir2/FILEONE-998877.txt not found: No...
832
Posted By wbport
Can't rcmd with star name
We have had a script here for years used to send files to other computers or to rcmd a command entered thru a prompt. A file we are looking for on the other computers will start with the same...
1,143
Posted By wbport
Right now my script look like:if [ $# -eq 1 -a -s...
Right now my script look like:if [ $# -eq 1 -a -s $1 ]
then
cp -p $1 $1.bak
echo "While using vi, $1.bak has been created."
sleep 1
fi
/usr/bin/vi $*
if [ -f $1.bak ]
then
rm $1.bak...
1,143
Posted By wbport
Problem with PATH
Recently I lost a number of changes I made to a program when the SCO Unix system went down. The system "mail" suggested a "vi -r" option that took me back several days. To prevent this in the...
2,316
Posted By wbport
Let's try this for a sed command file. You will...
Let's try this for a sed command file. You will need to specify -n before the name of your sed command file.
/-->/ { N
N
s/ *//
s/--//
s/>//
s/TP...
2,316
Posted By wbport
It looks like sed could be useful here. This is...
It looks like sed could be useful here. This is how you could start your control file (file name after sed -f)./-->/ { N
N
....................
s/ */,/g
}From...
Showing results 1 to 25 of 173

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