Sponsored Content
Top Forums Shell Programming and Scripting Sed: -e expression #1, char 16: unterminated address regex Post 302982504 by RudiC on Thursday 29th of September 2016 12:01:24 PM
Old 09-29-2016
After
Quote:
zcat is identical to gunzip -c. (On some systems, zcat may be installed as gzcat to preserve the original link to compress.) zcat uncompresses either a list of files
on the command line or its standard input and writes the uncompressed data on standard output.
(c.f. man zcat) there's no compressed data any more, so using zgrep is overkill (although it may work as zgrep recognizes and works on uncompressed data).

2nd point: you have
$do_action_on_cell_2=.... The $-sign is incorrect.

For the unterminated address regex error, we need to see what's going on. Try to run the command with the -vx options set to enable xtracing.
For the address range matching, the string you give for the starting address NEEDS to be found dot for dot, comma for comma, char for char, in the target file. Are you sure that's the case?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regex/sed - matching any char,space,underscore between : and /

trying to remove the portion in red: Data: mds_ar/bin/uedw92wp.ksh: $AI_SQL/wkly.sql mds_ar/bin/uedw92wp.ksh: $EDW_TMP/wkly.sql output to be: mds_ar/bin/uedw92wp.ksh: wkly.sql mds_ar/bin/uedw92wp.ksh: wkly.sql SED i'm trying to use: sed 's/:+\//: /g' input_file.dat >... (11 Replies)
Discussion started by: danmauer
11 Replies

2. Shell Programming and Scripting

Using SED command in a shell script: Unterminated address regex

Hi All, I am trying to use a sed command in a shell script in order to delete some lines in a file and I got the following error message. I don't understand why it is not working 'cause I have tried with simple quotes, then with double-quotes, and it is not working. sed: -e expression #1,... (7 Replies)
Discussion started by: Alpha3363
7 Replies

3. Shell Programming and Scripting

sed unterminated `s' command?

Hi there, I'm pretty new to this whole scripting thing. I've written myself something which takes my txt file of SMSes (the backup from the phone), and puts them into an email format, saving them as .eml files. I've tested and uploaded a batch to gmail, but because of threading issues, I've... (1 Reply)
Discussion started by: donnacha
1 Replies

4. Shell Programming and Scripting

sed: -e expression #1, char 21: unterminated `s' command

I have read many threads, but I still didn't find the right answer. May be i didn't find the right thread, though are so many threads for the same question. Basically the situation is - find date in a file and replace it with another date. (its not homework, its part of lot of a big processing,... (10 Replies)
Discussion started by: avinthm
10 Replies

5. Shell Programming and Scripting

SED With Regex to extract Email Address

Hi Folks, In my program, I have a variable which consists of multiple lines. i need to use each line as an input. My intention is to extract the email address of the user in each line and use it to process further. The email address could be anywhere in the whole line. But there will be only... (5 Replies)
Discussion started by: ragz_82
5 Replies

6. UNIX for Advanced & Expert Users

sed: -e expression #1, char 0: no previous regular expression

Hello All, I'm trying to extract the lines between two consecutive elements of an array from a file. My array looks like: problem_arr=(PRS111 PRS213 PRS234) j=0 while } ] do k=`expr $j + 1` sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt ---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies

7. Shell Programming and Scripting

sed returns error "sed: -e expression #1, char 18: unterminated `s' command"

Hello All, I have something like below LDC100/rel/prod/libinactrl.a LAA2000/rel/prod/libinactrl.a I want to remove till first forward slash that is outputshould be as below rel/prod/libinactrl.a rel/prod/libinactrl.a How can I do that ??? (8 Replies)
Discussion started by: anand.shah
8 Replies

8. Shell Programming and Scripting

Sed: -e expression #1, char 2: extra characters after command

Greetings.. getting the error while execution of the script, correct where i am missing #!/bin/bash DATE=`date +%Y-%m-%d:::%H:%M` HOSTNAME=`hostname` TXT="/log/temp.txt" LOGPATH="/log1/commanlogs/" IP=`/sbin/ifconfig | grep -i inet| head -n1| awk '{print $2}'| awk -F : '{print $2}'`... (7 Replies)
Discussion started by: manju98458
7 Replies

9. Shell Programming and Scripting

Unterminated Regular Expression

It is ok when I send send one arguement to $TILL in the awk expression. first(){ TILL=$1 echo $TILL awk '/:\\/ {P=0} P {print $0 "<br>"} FNR==1{printf("File %s:<br>", FILENAME)} /'$TILL'\/ {P=1} ' ${dirlist } } echo "<table border = '1'>" echo '<tr><td> </td><td>' ;... (3 Replies)
Discussion started by: alvinoo
3 Replies

10. UNIX for Beginners Questions & Answers

Sed: -e expression #1, char 20: unterminated address regex

I am trying to add word in last of particular line. the same command syntex is running on prompt. but in bash script give error."sed: -e expression #1, char 20: unterminated address regex" Please help. for i in `cat servername`; do ssh -q -t root@$i sed -i '/simple_allow_groups =/s/$/,... (4 Replies)
Discussion started by: yash_message
4 Replies
compress(1)						      General Commands Manual						       compress(1)

NAME
compress, uncompress, zcat - Compresses and expands data SYNOPSIS
compress [-cCdfFnqvV] [-b bits] [file...] uncompress [-cCfFnqvV] [file...] zcat [-n] [file...] STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: compress: XCU5.0 uncompress: XCU5.0 zcat: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Specifies the maximum number of bits to use to replace common substrings in the file. The default for bits is 16, with values of 9 through 16 acceptable. First, the algorithm uses 9-bit codes 257 through 512. Then it uses 10-bit codes, continuing until the bits limit is reached. (This option applies to the compress command only.) After the bits limit is attained, the compress command periodically checks the compression ratio. If it is increasing, compress continues to use the existing code dictionary. However, if the compression ratio decreases, compress discards the table of sub- strings and rebuilds it from the beginning. This lets the algorithm adapt to the next block of the file. [Tru64 UNIX] The -b option must be the last option on the command line. Makes compress and uncompress write to the standard out- put; no files are changed. The nondestructive behavior of zcat is identical to that of uncompress -c. [Tru64 UNIX] Produces out- put compatible with compress 2.0. [Tru64 UNIX] Uncompresses a file. When used with the compress command, forces the compression of file even if no reduction in the size of the file will occur. With both the compress and uncompress commands, if you run the command in the background and -f is not specified, you are prompted as to whether an existing file should be overwritten. [Tru64 UNIX] Specifies that no header has been added. [Tru64 UNIX] Speci- fies a quiet operation. This is the default. Diagnostics messages, which display if you specify the -v option, do not print. If the -q and -v options are both specified, the last one on the command line is honored. Prints the percentage reduction of each file when compressing the file. Prints messages to standard error concerning the expansion of each file when uncompressing the file. If the -q and -v options are both specified, the last one on the command line is honored. [Tru64 UNIX] Specifies a version. OPERANDS
The path name of a file to be processed. If - (hyphen) is used, standard input will be read. The compress command will create an output file name by appending a suffix of to the input file name. With the uncompress and zcat commands, if the file name has a suffix, the command will look for a file of that name. If the suffix is not specified, the command will append the suffix before searching for the file. The uncompress command will store output in a file named with the suffix removed if it was specified. If no suffix is specified, the uncompress command will accept file as the name of the output file and append a suffix before searching for the file. DESCRIPTION
The compress command reduces the size of the named files using adaptive Lempel-Ziv coding. Whenever possible, each file is replaced by one with the extension while keeping the same ownership modes, access, and modification times. If no files are specified, standard input is compressed to the standard output. Compressed files can be restored to their original form by using the uncompress or zcat command. The uncompress command replaces the compressed file with an uncompressed version of the file, identical to the file that was originally compressed with compress; the suffix is removed. When issuing an uncompress command, you can refer to the compressed target file with or without the suffix. If you do not specify the suffix, uncompress assumes it. The zcat command writes the uncompressed version of a compressed file to standard output. The compressed (.Z) files remain intact. The zcat command is identical to uncompress -c. When issuing a zcat command, you can refer to the compressed target file with or without the suffix; if you do not specify the suffix, zcat assumes it. [Tru64 UNIX] The compress command uses the modified Lempel-Ziv algorithm popularized in "A Technique for High Performance Data Compres- sion," Terry A. Welch, IEEE Computer, vol. 17, no. 6 (June 1984), pp. 8-19. The amount of compression obtained depends on the size of the input, the number of bits per code, and the distribution of common sub- strings. Typically, files containing source code or plain text are reduced by 50 to 60 percent. Compression is generally much better than that achieved by Huffman coding (as used in the pack command) or adaptive Huffman coding, and takes less time to compute. NOTES
[Tru64 UNIX] The compress command may not preserve the extended file attributes (property list) of a file, including the access control list (ACL) if any. Verify that any ACLs have not been removed or modified after using compress or uncompress. EXIT STATUS
The following exit values are returned: compress command Successful completion. An error occurred. One or more files were not compressed because they became larger. An error occurred. uncompress and zcat commands Successful completion. An error occurred. DIAGNOSTICS
Invalid arguments were specified on the command line. maxbits must follow -b. The file cannot be uncompressed because it was never com- pressed. The file was compressed by a program that could deal with more bits than the compress code on this machine. Recompress the file with smaller bits. file is assumed to be already compressed. Rename the file and try again. Respond y, or the locale's equivalent of a y, if you want the output file to be replaced; n, or the locale's equivalent of a n, if not. (The LC_MESSAGES variable determines the locale's equivalent of y or n.) A SIGSEGV violation was detected, which usually means that the input file is corrupted. Percentage of the input saved by compression (relevant only for -v). When the input file is not a regular file, (for example, a directory), it is left unal- tered. The input file has links; it is left unchanged. (See the ln command for more information.) No saving is achieved by compression. The input remains unchanged. EXAMPLES
To compress folder and print the savings, enter: compress -v folder The system responds with a message like: folder: Compression: 43.94% -- replaced with folder.Z The following command displays the uncompressed version of the testlog.Z file: zcat testlog.Z ENVIRONMENT VARIABLES
The following environment variables affect the execution of compress, uncompress, and zcat: Provides a default value for the international- ization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: pack(1), pcat(1), unpack(1) Files: acl(4) Standards: standards(5) compress(1)
All times are GMT -4. The time now is 08:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy