Search Results

Search: Posts Made By: badg3r
4,693
Posted By badg3r
Odd Control Character issue ^A
Sorry to bug you, but my sed is failing me,

I have a file auto generated from abinitio, it has a string of chars ending with a line break, and then it has added a ^A character, I can remove this...
3,468
Posted By badg3r
In the couple of hours between submitting...
In the couple of hours between submitting question for moderation and posting I have written the following



#Get list of unique dates for which we have files for
for dates in `ls *0* |grep -v...
3,468
Posted By badg3r
extracting and using date from filenames in a loop
HIya,

Having a dumb day whilst writing an archive process in Shell want to extract from the filename the date and archive into tar files based on this, I don't want to use mtime as it may not be...
5,295
Posted By badg3r
Your main problem is: : Class Not Found:...
Your main problem is:

: Class Not Found: JDBC driver oracle.jdbc.driver.OracleDriver could not be loaded

You need to make sure that this is referenced in the environmental variables, at the...
27,022
Posted By badg3r
The below works to make the logfile from a cron...
The below works to make the logfile from a cron entry date specific:

00 11 * * * /scripts/scriptname.sh > /logs/log`date +%d%m%y`.log 2>&1

Or in the script:

DATE_STAMP=` date +%Y%m%d`
...
28,064
Posted By badg3r
compress ALL non compressed files in a directory
I have now finished my script that will compress all uncompressed files in a directory, thought I'd post it to help anyone else out.

#!/bin/ksh

TEST_FILE=/tmp/tester$$
FILE=/tmp/result$$


...
28,064
Posted By badg3r
Could you elaborate please?
Could you elaborate please?
28,064
Posted By badg3r
Check if file compressed or not
Is there a way I can check if a file is comppressed or not? (Be it tar/gzip or compress). trying to write a generic housekeeping scrit that will delete files over 6 months old and compress any...
7,365
Posted By badg3r
Ah, my blunder. Thank you it is now working as...
Ah, my blunder. Thank you it is now working as it should. :D
7,365
Posted By badg3r
Been trying with this one: awk '/^01,/...
Been trying with this one:

awk '/^01,/ {ones++} /^02,/ {twos++} END {exit ones && twos}' < testfile.txt

RETCODE=$?
if [ $RETCODE -eq 0 ]
then
echo "File contains one type 01, 02" ...
7,365
Posted By badg3r
trying to get a boolean response from sed
I have a file coming in with many columns, but the first character of the the coumn is a record type, if I wanted to get a true/false kind of response as to whether it contains at least one of each...
5,153
Posted By badg3r
In the end I got this working: #This gets...
In the end I got this working:

#This gets the occurrences of the subheader I wish to split on
awk -F"," '$2 != prev && $1=="03" && NR !=1 { print (NR*2)-1; prev = $2 }' MyFile > data

#This...
5,153
Posted By badg3r
csplit not behaving
I have a large file with the first 2 characters of each line determining the type of record. type 03 being a subheader and then it will have multiple 04 records.

eg: 03,xxx,xxxx,xxxx
...
Showing results 1 to 13 of 13

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