Sponsored Content
Top Forums Shell Programming and Scripting Compare string length to a number Post 302979966 by balajesuri on Monday 22nd of August 2016 12:33:51 PM
Old 08-22-2016
Merely posting that there are errors is not helping much.
  1. What errors do you get on running this script?
  2. What did you understand from the errors?

Last edited by rbatte1; 08-25-2016 at 08:44 AM.. Reason: Converted to formatted number-list
This User Gave Thanks to balajesuri For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed problem - replacement string should be same length as matching string.

Hi guys, I hope you can help me with my problem. I have a text file that contains lines like this: 78 ANGELO -809.05 79 ANGELO2 -5,000.06 I need to find all occurences of amounts that are negative and replace them with x's 78 ANGELO xxxxxxx 79... (4 Replies)
Discussion started by: amangeles
4 Replies

2. Shell Programming and Scripting

read string, check string length and cut

Hello All, Plz help me with: I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
Discussion started by: ozzy80
9 Replies

3. Shell Programming and Scripting

how can i compare te length of the string

how can i campare te length of the string $var = unix if ( $var -eq 4 ) then.. is it right (6 Replies)
Discussion started by: mail2sant
6 Replies

4. Shell Programming and Scripting

How to Compare two files depend on line length Chars

I need to compare two files with exactly same length as example: - File1 contain 500 records with length of 640 chars of each line. File2 contain 1500 records with length of 640 chars of each line. I need get an output to be written in File3 which will contain 1000 records difference. but... (4 Replies)
Discussion started by: elj3dah
4 Replies

5. UNIX for Dummies Questions & Answers

Read a string with leading spaces and find the length of the string

HI In my script, i am reading the input from the user and want to find the length of the string. The input may contain leading spaces. Right now, when leading spaces are there, they are not counted. Kindly help me My script is like below. I am using the ksh. #!/usr/bin/ksh echo... (2 Replies)
Discussion started by: dayamatrix
2 Replies

6. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

7. UNIX for Dummies Questions & Answers

compare 2 very large lists of different length

I have two very large datasets (>100MB) in a simple vertical list format. They are of different size and with different order and formatting (e.g. whitespace and some other minor cruft that would thwart easy regex). Let's call them set1 and set2. I want to check set2 to see if it contains... (2 Replies)
Discussion started by: uiop44
2 Replies

8. Shell Programming and Scripting

[awk]compare a number in a string with a list

Hi, I have a program written in awk and I want to extend it to do another task. My program is a list of CVS log reports of a repository. For each file, I have some fields. One of the fields is the comment field. I want to know how I can check if a comment (which is a free text field)... (8 Replies)
Discussion started by: sandeepk1611
8 Replies

9. Shell Programming and Scripting

Pass column number as variable to awk and compare with a string.

Hi All, I have a file test.txt. Content of test.txt : 1 vinay se 2 kumar sse 4 kishore tl I am extracting the content of file with below command. awk '$2 ~ "vinay" {print $0}' test.txt Now instead of hardcoding $2 is there any way pass $2 as variable and compare with a... (7 Replies)
Discussion started by: Girish19
7 Replies

10. UNIX for Beginners Questions & Answers

Concatenate a string and number and compare that with another string in awk script

I have below code inside my awk script if ( $0 ~ /SVC IN:/ ) { svc_in=substr( $0,23 , 3); if (msg_start == 1 && msg_end == 0) { msg_arr=$0; } } else if ( $0 ~ /^SVC OUT:/ ) { svc_out=substr( $0, 9, 3); if (msg_start == 1 && msg_end == 0) ... (6 Replies)
Discussion started by: bhagya123
6 Replies
br(1)							      General Commands Manual							     br(1)

NAME
br - utility to interact with Firecracker device SYNOPSIS
br [options] [housecode[list]] [native command] ... DESCRIPTION
This manual page documents briefly the br command. br is a program that interacts with X10's Firecracker device allowing the user to manipulate X10 devices throughout their house/office. OPTIONS
The programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options are included below. -h, --help Show summary of options. -v, --verbose Each -v will increase the verbosity. -x, --port=PORT Set port to communicate with (should be the port the Firecracker module is plugged into) -c, --house=[A-P] Use alternate house code for operations, default is A -n, --on=LIST Turn on all devices in LIST -f, --off=LIST Turn off all devices in LIST -N, --ON Turn on all devices in housecode -F, --OFF Turn off all devices in housecode -d, --dim=LEVEL[,LIST] Dim devices in housecode [or LIST] to relative LEVEL -B, --lamps_on Turn on all lamps in housecode -D, --lamps_off Turn off all lamps in housecode -r, --repeat=NUM Repeat commands NUM times (0 = ~forever) AUTHOR
This manual page was written by Ashley Clark <aclark@debian.org>, for the Debian GNU/Linux system (but may be used by others). Ashley Clark br(1)
All times are GMT -4. The time now is 10:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy