Sponsored Content
Top Forums Shell Programming and Scripting Testing the length of a string Post 302623947 by Scrutinizer on Sunday 15th of April 2012 10:55:19 AM
Old 04-15-2012
OK, in this case it can be done through variable expansion.
 

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
AUPLAY(1)						      General Commands Manual							 AUPLAY(1)

NAME
auplay - play a sound file to a Network Audio System server SYNOPSIS
auplay [-audio servername] [-volume 0-100] [-i] [-I] [-l] files... DESCRIPTION
The auplay program can be used to play audio data stored in the .SND, .AU, or .WAV formats common on Sun workstations and PCs. It is typi- cally used from shell scripts or command line procedures. If no filenames are given on the command line, audio data will be read fron stdin, unless the -l option is given. OPTIONS
The following options may be used with the auplay program: -audio servername This option specifies the Network Audio System server on which the files should be played. -volume 0-100 This option specifies the volume at which the data should be played as a percentage of the maximum possible volume. The default is 100 percent. -i This option indicates that the header information associated with the sound data should be printed along with playing the data. -I This option indicates that the header information associated with the sound data should be printed instead of playing the data. -l This option indicates that a list of filenames is to be read from stdin. auplay will play these files after playing any files given explicitly as command line arguments. SEE ALSO
nas(1), auctl(1), audemo(1), autool(1) COPYRIGHT
Copyright 1993, 1994 Network Computing Devices, Inc. AUTHOR
Greg Renda, Network Computing Devices, Inc. 1.9.3 AUPLAY(1)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy