Sponsored Content
Top Forums Shell Programming and Scripting Cut command on RHEL 6.8 compatibility issues Post 302976545 by Don Cragun on Thursday 30th of June 2016 02:24:56 PM
Old 06-30-2016
The only way to make sure that your wrapper is always called instead of the OS supplied utility is to move the OS supplied utility to a different location and install your wrapper in the location where your OS installed cut originally.

Of course, once you have installed this wrapper, your code might or might not work properly (depending on the quality of your wrapper) and no one else on your system will be able to look at the diagnostics produced by scripts that have bugs in the way they specify field and character ranges so they can identify and fix their code.

My personal opinion is that you should spend time fixing your scripts that call cut -c 0...., cut -f 0..., and lots of other possible misuses of 0 that are now correctly diagnosed as errors by the new version of cut instead of debugging code to be sure that it changes all of the appropriate 0 characters in its argument list to 1 characters and doesn't change any 0 characters that are correctly specified and do not reference a character 0 or field 0.
These 2 Users Gave Thanks to Don Cragun For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issues with cut

We are running on a Sun cluster using ksh. We have a script that has been running for about six months with no issues. The script has not been modified and our results are now coming out diffrent. <BEGIN> cat $exfile | while read line do ... (1 Reply)
Discussion started by: bthomas
1 Replies

2. UNIX for Dummies Questions & Answers

Date time issues on RHEL

Hi, I am facing a weird problem with the 'Date'. If I check date multiple times in a short interval I see a different time altogether. Here is an example $ date Tue Jul 15 02:07:22 PDT 2008 $ date Tue Jul 15 02:07:23 PDT 2008 $ date Tue Jul 15 03:20:42 PDT 2008 $ date Tue Jul 15... (5 Replies)
Discussion started by: sumitb74
5 Replies

3. UNIX for Dummies Questions & Answers

having issues in using Cut Command

Hi, I would like to ask for your help with my problem, im writing a unix script to remove characters before the symbol "/", but the one being removed are characters after the symbol. Ive searched over the internet and found no answer.. hope you can help me with this. sample: text... (2 Replies)
Discussion started by: paoie
2 Replies

4. Red Hat

Apache / Tomcat / APR Issues [RHEL]

Evening, I'm posting for help here, because I'll be honest I've reached the end of my tether, hopefully someone can give me some assistance and help me maintain a level of sanity... I maintain a number of webservers on RHEL 5 64Bit (Red Hat Enterprise Linux Server release 5.3 (Tikanga)), the... (2 Replies)
Discussion started by: cpickering
2 Replies

5. Red Hat

Does RHEL 5 provide a command to collect RHEL system log in single compress file?

Hi, I heard a command that can collect all RHEL 5 log in a single compress file before I forget. Does any body know...What the command is ? Thanks. (4 Replies)
Discussion started by: nnnnnnine
4 Replies

6. Homework & Coursework Questions

sed & cut command issues

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: After using the egrep command to pull certain lines from the asg5f1 (creating the asg5f1c file), I am required... (1 Reply)
Discussion started by: robrom78
1 Replies

7. IP Networking

Test Network Routing Issues (FREEBSD and RHEL)

Hello, I'm attempting to setup a test network with a client-server based architecture using a proprietary application. The client works by communicating with the server on separate links (typically cellular connections) and then initiates a tunnel over each active link. However, in place of the... (0 Replies)
Discussion started by: shadyuk
0 Replies

8. Shell Programming and Scripting

Compatibility issues between Sun solaries & AIX commands.

Hi, I am migrating few of the shell scripts from existing SUN Solaries to AIX. My script contains some command like 'dos2unix' and 'unix2dos' which are not compatible in AIX flavour. Please let me know if there is any such commands in AIX which can replace these commands. Thanks. (1 Reply)
Discussion started by: 46019
1 Replies

9. Red Hat

RHEL 7 distribution compatibility

Hi all, I'm new here. I am currently using RHEL 6.10 and transitioning to RHEL 7 soon. Some of my GUI developments are developed using Glade v2.6.8. My question is: Is Glade v2.6.8 compatible with RHEL 7? Do I need to install additional libraries or dependencies? I looked up the list of... (1 Reply)
Discussion started by: chaosvn
1 Replies
CUT(1)							    BSD General Commands Manual 						    CUT(1)

NAME
cut -- select portions of each line of a file SYNOPSIS
cut -b list [-n] [file ...] cut -c list [file ...] cut -f list [-d delim] [-s] [file ...] DESCRIPTION
The cut utility selects portions of each line (as specified by list) from each file and writes them to the standard output. If the file argument is a single dash ('-') or no file arguments were specified, lines are read from the standard input. The items specified by list can be in terms of column position or in terms of fields delimited by a special character. Column numbering starts from 1. list is a comma or whitespace separated set of increasing numbers and/or number ranges. Number ranges consist of a number, a dash (-), and a second number and select the fields or columns from the first number to the second, inclusive. Numbers or number ranges may be preceded by a dash, which selects all fields or columns from 1 to the first number. Numbers or number ranges may be followed by a dash, which selects all fields or columns from the last number to the end of the line. Numbers and number ranges may be repeated, overlapping, and in any order. It is not an error to select fields or columns not present in the input line. The options are as follows: -b list The list specifies byte positions. -c list The list specifies character positions. -d string Use the first character of string as the field delimiter character. The default is the <TAB> character. -f list The list specifies fields, separated by the field delimiter character. The selected fields are output, separated by the field delimiter character. -n Do not split multi-byte characters. -s Suppresses lines with no field delimiter characters. Unless specified, lines with no delimiters are passed through unmodified. EXIT STATUS
cut exits 0 on success, 1 if an error occurred. SEE ALSO
paste(1) STANDARDS
The cut utility conforms to IEEE Std 1003.2-1992 (``POSIX.2''). BSD
December 21, 2008 BSD
All times are GMT -4. The time now is 07:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy