Sponsored Content
Top Forums Shell Programming and Scripting Testing the length of a string Post 302623927 by intelinside on Sunday 15th of April 2012 10:21:25 AM
Old 04-15-2012
Testing the length of a string

Hello, Unix-Forums!

Is there a command that can check how long a user-entered string is?

Please don't give me a code, just the name of the command (playing around yourself is much more fun than just pasting code)

edit: I'm sorry, first hit of the forum search gave me the answer.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Testing the last character in a string

Hi In the shell scripted I'm trying to write! I would like to test the last character in a string. The string is a path/directory and I want to see if the last character is a '/'. The string (path/directory) is inputted by a user. If the '/' character isn't present then I want to be able to... (11 Replies)
Discussion started by: dbrundrett
11 Replies

2. UNIX for Dummies Questions & Answers

length of the string

Hi all, pls help me in finding the length of the given string, do we need to write a code seperately or is there any command?? pls help. (3 Replies)
Discussion started by: vasikaran
3 Replies

3. 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

4. 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

5. UNIX for Dummies Questions & Answers

length of string

Hi lets say i have a variable output="string" how can you find the length of the string contained in this variable? i guess "wc" cannot be used. its only for files. (8 Replies)
Discussion started by: silas.john
8 Replies

6. Shell Programming and Scripting

testing length

I've never tested file length with shell before and I'm having problems. What I'm doing is testing $filename and $filename.bak to see if there is a difference. so I use 'diff' for that and send it to an output file 'dif.txt'. Now I wanna see if the length of 'dif.txt' is zero or not. that's where... (1 Reply)
Discussion started by: astonmartin
1 Replies

7. Shell Programming and Scripting

need help testing for length of variable

Hello, I'm new to shell scripting and need a little help please. I'm working on a script that asks the user to input a name that can be 1 to 12 alphanumeric characters and can have dots(.) dashes(-) and spaces. I want to test that the answer is valid and if not make the user try again. I have no... (4 Replies)
Discussion started by: wlewis
4 Replies

8. Programming

regarding string length

Helo, I have character array of sixe 128 char filename now I have one problem that when I enter filename as nothing I got value as " " ",`\0` " . when I find this string length ( " ",`\0`) as 1(one). actually I want to make this length as zero. so what should I do (10 Replies)
Discussion started by: amitpansuria
10 Replies

9. 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

10. UNIX for Dummies Questions & Answers

Testing for non-zero length string

Hello, can someone please explain to me why this happens: myserver#echo "$nothing" myserver#if ; then echo "nothing is a zero length string"; fi nothing is a zero length string myserver#if ; then echo "nothing is also a non-zero length string, apparently"; fi nothing is also a non-zero... (5 Replies)
Discussion started by: longjon
5 Replies
Pang Zero(6)							       Games							      Pang Zero(6)

NAME
pangzero - action game that involves popping balloons with a harpoon SYNOPSIS
pangzero DESCRIPTION
Pang Zero is a clone and enhancement of Super Pang, a fast-paced action game that involves popping balloons with a harpoon. The intention is to create a fun, open-source game that many (currently up to 6) people can play together. You can play Pang Zero alone, but it's a lot more fun to play with your friends. USAGE
The purpose of the game is to destroy balls using a harpoon. When those balls are hit, they will split into two smaller balls until they are totally destroyed. There are also some special balls which will appear during the game. Right after starting the game you will have a menu available, in which you will be able to select some playing options. You can use cursor keys to navigate through menuoptions and use Enter to select one. 'P' key pauses the game, and Esc quits. In that menu, you can select the number of players (between 1 and 6), Select some game options, like turn the sound or the music on and off, or switch between fullscreen, windowed screen or widescreen. You can also select the keys for the players. There's a tutorial available through the starting menu, that you can use to learn how to play. FILES
~/.pangzerorc This is where Pang Zero stores user data and game configuration. AUTHOR
Pang Zero was written by UPi. This manual page was written for Debian by Miriam Ruiz <little_miry@yahoo.es>. SEE ALSO
UPi 8 December 2006 Pang Zero(6)
All times are GMT -4. The time now is 08:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy