Search Results

Search: Posts Made By: wbport
19,012
Posted By Don Cragun
Try: tr -d '\0' < file_with_nulls >...
Try:
tr -d '\0' < file_with_nulls > file_without_nulls
Note that the filename you use for the output file must NOT be a name of your input file.
850
Posted By RudiC
Hold it. We all are just poking in the dark. ...
Hold it. We all are just poking in the dark.

Please draw the entire picture, including sensible error messages. An execution log of the program run (set -x option) might be helpful.
Pls show
...
1,126
Posted By Scrutinizer
Hi, OK. So to match 6 digits on a line only,...
Hi, OK.

So to match 6 digits on a line only, try:
/^[0-9]\{6\}$/{

Also note that a \ inside square brackets denotes a literal \ character, not an escape.
1,126
Posted By Scrutinizer
Your data sample show a first line with 6 digits,...
Your data sample show a first line with 6 digits, whereas your sed script in post#1 tests for 6 digits followed by any character that is neither . or a \ . So the script will not match the first line...
2,844
Posted By Don Cragun
Assuming that your sort utility has a -M option...
Assuming that your sort utility has a -M option (which is not required in standard sort utilities), you might want to try the following:
sort -k9,9n -k5,5M -k6,6n -k7,7
to perform a numeric sort on...
533
Posted By RudiC
Confusing specification, many wild guesses! ...
Confusing specification, many wild guesses!

How about
awk '
{TYPE = substr ($4, 1, 1)
sub (TYPE, "", $4)
print $1, $2, "PIC " (TYPE~/[SN]/?TYPE:"") "9(" $3-$4 ")"...
1,145
Posted By apmcd47
Doesn't this work? grep -v "T$" filename...
Doesn't this work?

grep -v "T$" filename |egrep -v "^$" |sort | cut -c 1-78,80

Could the two greps also be condensed into
egrep -v 'T$|^$' filename ...
Andrew
7,559
Posted By Don Cragun
To keep from getting false positives (Chubler_XL...
To keep from getting false positives (Chubler_XL and RudiC, try your suggestion with $1 set to OE and $2 set to Jo with your test dataset) by actually matching the double quotes in the file, one...
7,559
Posted By RudiC
What do you need the single quotes for? Did you...
What do you need the single quotes for? Did you try without?
923
Posted By Scrutinizer
Try using: ls -lrS also: if [ "$1" = "-r" ]...
Try using:
ls -lrS
also:
if [ "$1" = "-r" ]

( -eq is for numerical comparisons )
3,389
Posted By Don Cragun
Pass the search pattern as the 1st argument to...
Pass the search pattern as the 1st argument to your script, then:
# If not .savenn file, show name and result of grep.
#
pattern=$1
shift
for i in "$@"
do
echo $i |grep -q 'save[01][0-9]'
...
5,086
Posted By drysdalk
Hi, The inode thing is exactly what I've...
Hi,

The inode thing is exactly what I've always done in this situtation. But I just thought I'd have a play about and see if I could find another answer, and there's this approach too (which...
5,086
Posted By drl
Hi. If for just this file in this directory:...
Hi.

If for just this file in this directory:
mv -i "Wrong*Right" Right
Otherwise use the scripts noted in previous posts.

Best wishes ... cheers, drl
5,086
Posted By Corona688
Try ls -i to get the inode of the file. This...
Try ls -i to get the inode of the file. This will uniquely identify it without depending on the filename. Then you can give that inode to find and have it feed the filename into mv for you.

$ ls...
1,072
Posted By blastit.fr
You should use either curl or wget . If you're...
You should use either curl or wget .
If you're not allowed to install such software, you should try perl with LWP.
See: A Simple way to download many web pages using Perl...
1,615
Posted By Don Cragun
There are ways to directly enter escape...
There are ways to directly enter escape characters into shell commands, but the method varies depending on what shell you're using, command history editing mode, etc.; but the following should work...
1,615
Posted By RudiC
Would mv -i *G or rm -i *G help? Apply utmost...
Would mv -i *G or rm -i *G help? Apply utmost care when answering the confirmation question!
1,615
Posted By Corona688
cd to the folder it's in, get its inode number...
cd to the folder it's in, get its inode number with ls -li, then

find . -inum inodenumber -exec echo rm '{}' ';'

Remove the 'echo' once you've tested it and are sure it does what you want.
Forum: Programming 07-22-2016
1,540
Posted By drl
Hi. I don't use COBOL, but a quick glance...
Hi.

I don't use COBOL, but a quick glance at the results of a search for COBOL statement syntax yielded a possibility for a solution: COBOL: Language Reference...
Forum: Programming 06-28-2016
3,266
Posted By Corona688
From man fsetpos: The fgetpos() and...
From man fsetpos:

The fgetpos() and fsetpos() functions are alternate interfaces equivaâ
lent to ftell() and fseek() (with whence set to SEEK_SET), setting and
storing the...
Forum: SCO 12-22-2015
6,250
Posted By RudiC
I guess - as it is not too clear - that you want...
I guess - as it is not too clear - that you want the second grepto match your file. Try the alternation (using | ) in a subexpression:grep -E 'AAA-BBB([^-]|$)' file (you may have to switch on...
Forum: SCO 12-22-2015
6,250
Posted By MadeInGermany
Using a $ anchor you can address all trailing...
Using a $ anchor you can address all trailing characters
grep 'AAA[^-]*$' file
1,409
Posted By neutronscott
I implied you needed to use ksh for that. It...
I implied you needed to use ksh for that. It should be your default shell, IMO, giving what SCO's documentation lists as available (ksh, csh, sh).

I don't have access to SCO but no sh should have...
2,368
Posted By Don Cragun
I'm not sure I understand what you're trying to...
I'm not sure I understand what you're trying to do, but if I'm guessing correctly, try:
awk '{print substr($0, 1, 80) substr($0, 98)}' file
If you want to try this on a Solaris/SunOS system, change...
1,183
Posted By Chubler_XL
rsync is a great tool for this sort of job. ...
rsync is a great tool for this sort of job.

He we are saying copy any newer files from the structure below directoryA to an equivalent structure below directoryB without creating any new files or...
Showing results 1 to 25 of 40

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