Sponsored Content
Full Discussion: Remove trailing space
Top Forums Shell Programming and Scripting Remove trailing space Post 302828977 by munna_dude on Wednesday 3rd of July 2013 04:29:17 PM
Old 07-03-2013
Remove trailing space

Hi

I am trying to remove trailing space from a string.

Code:
value=${value%% }

It is not working. What might be the issue with the above snippet.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

re: removing trailing space from lines

Not sure why this thread was closed without any explanation, but you can do what you're asking with sed 's/]*$//g' < sourceFile > destFile (1 Reply)
Discussion started by: oombera
1 Replies

2. UNIX for Dummies Questions & Answers

How to remove trailing spaces

Hi, I have a file like this (ADD_MONTHS((Substr(Trim(BOTH FROM Translate(Maximum(closeDa ------------------------------------------------------------ 2007-06-30 00:00:00 I have a requirement where i need just the date. When i do: tail -1... (2 Replies)
Discussion started by: mahek_bedi
2 Replies

3. Shell Programming and Scripting

Remove trailing G

Hello, I am trying to write a script that will calculate the amount of data remaining in a storage volume. I'm running Tru64 Unix version 5.1B patch kit 6. The script is being run against an AdvFS domain. I am programming in Korn Shell version M-11/16/88f. The basic idea is that I want to run df... (3 Replies)
Discussion started by: Heathe_Kyle
3 Replies

4. Shell Programming and Scripting

Delete trailing white space

I have a string "disk0 with a trailing white space after it" but I want to get rid of this white space from right to left so that I am left with "disk0" only. Using sed 's/ $//g' doesn't seem to work Any ideas ? Thanks (5 Replies)
Discussion started by: cillmor
5 Replies

5. Shell Programming and Scripting

Remove trailing zeros

Hi I have a simple request but can't find the answer. I want to remove trailing zeros, and in some cases the fullstops, from the input data. Example of input file: FR002_15.000_20.000 SD475_5.000_10.500 FG5647_12.250_15.500 BH2463_30.555_32.000 Desired output file would be: ... (10 Replies)
Discussion started by: theflamingmoe
10 Replies

6. Shell Programming and Scripting

Remove trailing 0 from the field

Hi Freinds, I have file1.txt as below file1.txt 1521894~~-0.400~201207 1521794~~-0.486~201207 152494~~-0.490~201207 152154894~~-0.490~201207 1521894354~~-0.489~201207 expected output : 1521894~~-0.4~201207 1521794~~-0.486~201207 152494~~-0.49~201207... (9 Replies)
Discussion started by: i150371485
9 Replies

7. Shell Programming and Scripting

Replacing trailing space with single quote

Platform : RHEL 5.8 I want to end each line of this file with a single quote. $ cat hello.txt blueskies minnie mickey gravity snoopyAt VI editor's command mode, I have used the following command to replace the last character with a single quote. ~ ~ ~ :%s/$/'/gNow, the lines in the... (10 Replies)
Discussion started by: John K
10 Replies

8. Shell Programming and Scripting

Remove trailing number

I have some strings such as ABC1 ABC2 TYFASDD12 They will only have letters and numbers. In each case I want to remove the last digit? The lengths will vary. So a hard coded substr won't work. What do I do? if it doesn't end in a number, I don't want to remove any characters. (6 Replies)
Discussion started by: guessingo
6 Replies

9. Shell Programming and Scripting

Remove trailing space from file and folder names

I have a folder that contains many sub folders and files. This tree has to be backed up to an archive system. According to the tech support, one of the archives is failing to back up due to the possibility of trailing spaces on file and folder names. Therefore, I would like to have a script... (16 Replies)
Discussion started by: vipertech
16 Replies

10. Shell Programming and Scripting

Remove trailing space in Gawk

Hi, I have simply made a shell script to convert *.csv to *.xml file. Xml file is required for input to one tool. But i am getting space after last field. How can i remove it. Shell script is as follows :- if then echo "" echo "Wrong syntax, Databse_update.sh... (6 Replies)
Discussion started by: stillrules
6 Replies
MEMCACHED_CAS(3)						   libmemcached 						  MEMCACHED_CAS(3)

NAME
memcached_cas - Working with data on the server in an atomic fashion SYNOPSIS
#include <libmemcached/memcached.h> memcached_return_t memcached_cas(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas) memcached_return_t memcached_cas_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas) Compile and link with -lmemcached DESCRIPTION
memcached_cas() overwrites data in the server as long as the "cas" value is still the same in the server. You can get the cas value of a result by calling memcached_result_cas() on a memcached_result_st(3) structure. At the point that this note was written cas is still buggy in memached. Turning on tests for it in libmemcached(3) is optional. Please see memcached_set() for information on how to do this. memcached_cas_by_key() method behaves in a similar method as the non key methods. The difference is that it uses the group_key parameter to map objects to particular servers. memcached_cas() is testsed with the MEMCACHED_BEHAVIOR_USE_UDP behavior enabled. However, when using these operations with this behavior on, there are limits to the size of the payload being sent to the server. The reason for these limits is that the Memcached Server does not allow multi-datagram requests and the current server implementation sets a datagram size to 1400 bytes. Due to protocol overhead, the actual limit of the user supplied data is less than 1400 bytes and depends on the protocol in use as, well as the operation being executed. When running with the binary protocol, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, the size of the key,value, flags and expiry combined may not exceed 1368 bytes. When running with the ASCII protocol, the exact limit fluctuates depending on which function is being executed and whether the function is a cas operation or not. For non-cas ASCII set operations, there are at least 1335 bytes available to split among the key, key_prefix, and value; for cas ASCII operations there are at least 1318 bytes available to split among the key, key_prefix and value. If the total size of the command, including overhead, exceeds 1400 bytes, a MEMCACHED_WRITE_FAILURE will be returned. RETURN
All methods return a value of type memcached_return_t. On success the value will be MEMCACHED_SUCCESS. Use memcached_strerror() to trans- late this value to a printable string. HOME
To find out more information please check: http://libmemcached.org/ SEE ALSO
memcached(1) libmemached(3) memcached_strerror(3) memcached_set(3) memcached_append(3) memcached_add(3) memcached_prepend(3) mem- cached_replace(3) AUTHOR
Brian Aker COPYRIGHT
2011, Brian Aker DataDifferential, http://datadifferential.com/ 1.0.8 May 22, 2012 MEMCACHED_CAS(3)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy