Sponsored Content
Top Forums Shell Programming and Scripting Bash: How to remove the last character of a string? Post 302599694 by LessNux on Friday 17th of February 2012 11:58:45 PM
Old 02-18-2012
Hello carldamon,

You seem to have barged into my thread by posting a question that is not related to my original post.

Remove your post from this thread, and create a new thread of your own, please.

LessNux (OP)

----------

Update:

Hello mikelking,

The question that carldamon posted in this thread has nothing to do with my original post. Therefore, your replies to carldamon have nothing to do with my original post. So, remove your replies to carldamon, please. However, keep your reply to my original post. Thanks.

LessNux (OP)

Last edited by LessNux; 02-18-2012 at 01:11 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash while read how to remove \n character

Hi, I've made a script to grep a file for i in `cat filename.txt` do strings ./binfile | grep "$i" 2>&1 > /dev/null done this works fine as long as in filename.txt i don't have any entries with spaces. But in my case i want to grep something with spaces like "lala tata" and... (3 Replies)
Discussion started by: papasj
3 Replies

2. Shell Programming and Scripting

shell script to remove the last character(.) of a string

hi I have a list of words in a text file. these words are appended by "." at their end. They look something like this. word1. word2. word3. word4. word5. I need to remove the last character "." from all the words. The output must look something like this. word1 word2 word3... (7 Replies)
Discussion started by: ss3944
7 Replies

3. Shell Programming and Scripting

How to remove the first character on a string in a variable

Hi all, Does anyone know how to code in ksh that will remove the first character in a string variable and replace that variable without the first character? Example: var1=ktest1 will become var1=test1 var2=rtest2 will become var2=test2 Need help please. (10 Replies)
Discussion started by: ryukishin_17
10 Replies

4. Shell Programming and Scripting

How to remove last character in a string read from file

Hello, The last character is a comma , I have tried the following: sed -e 's/\,$//' filename-to-read however - there are still commas at the end of each line...:confused: (5 Replies)
Discussion started by: learning
5 Replies

5. Shell Programming and Scripting

Sed is doing my head in! How do you remove the first character of a string?

Hello! Please bare with me, I'm a total newbie to scripting. Here's the sudo code of what I'm trying to do: Get file name Does file exist? If true get length of file name get network id (this will be the last 3 numbers of the file name) loop x 2 If... (1 Reply)
Discussion started by: KatieV
1 Replies

6. Shell Programming and Scripting

remove all occurrences of a character at the beginning of a string

Hi there, i need some help to remove all occurrences of a certain character at the beginning of a string. Example: my string is 00102030 and i want to remove all zeros from beginning of string so the result is 102030 (3 Replies)
Discussion started by: gigagigosu
3 Replies

7. Shell Programming and Scripting

remove the first and last character of a string

How can i remove the first and last character of strings like below: "^^^613*" "admt130" "^^^613*" "123456" "adg8484" "DQitYV09dh1C" Means i wanna remove the quotes(""). Please help (17 Replies)
Discussion started by: proactiveaditya
17 Replies

8. Shell Programming and Scripting

gawk to remove last character in a line or string

I am outputting a line like this print $2 "/" $4The last character though is a ":" and I want to remove it. Is there any neat way to remove it? Or am I forced to do something like this: print $2 "/" substr($4, 1, length($4) - 1)Thanks. (6 Replies)
Discussion started by: benalt
6 Replies

9. UNIX for Beginners Questions & Answers

Remove string between number and character

hello ! I have to remove string between a number and set of characters. For example, 35818 -stress - - -stress - - - - - - DB-3754 44412 caul kid notify DB-3747 54432 roberto -, notify DB-3725 55522 aws _ _int _ _classified 2_a _a 2_m _m 2_classified 2_search... (7 Replies)
Discussion started by: ManoharMa
7 Replies

10. UNIX for Beginners Questions & Answers

Escape bash-special character in a bash string

Hi, I am new in bash scripting. In my work, I provide support to several users and when I connect to their computers I use the same admin and password, so I am trying to create a script that will only ask me for the IP address and then connect to the computer without having me to type the user... (5 Replies)
Discussion started by: arcoa05
5 Replies
postwait(2)							System Calls Manual						       postwait(2)

NAME
postwait: pw_getukid(), pw_wait(), pw_post(), pw_postv(), pw_getvmax() - lightweight synchronization mechanism SYNOPSIS
DESCRIPTION
Postwait is a fast, lightweight sleep/wakeup mechanism that can be used for synchronization by cooperating kernel threads within a single process or between separate processes. A thread calls to block. It resumes execution when it is posted by another thread, the call expires, or is signaled. If one or more posts are already pending, returns immediately. Threads using postwait are identified by their ukid. A thread retrieves its ukid by calling It shares this ukid with anyone it chooses by any means it considers appropriate (for example, shared memory). is called with a timeout ts. If ts is NULL, the thread will not timeout. It will remain blocked until posted or a signal wakes it up. If ts points to a zero-valued timespec, will return immediately with a value (and indicating whether or not it was posted. If ts points to a timespec whose value is greater than zero, the thread will block for that amount of time unless it is posted or inter- rupted by a signal, in which case the timespec pointed to by ts is updated with the remaining time. The return value and are set to indi- cate the reason the call returned. is used to post many threads with a single call. It posts to all threads in the targets array. An value for each target is returned in the errors array. (0 indicates success.) If the errors pointer is zero, no target-specific errors are copied out. There is a maximum number of threads that can be posted with a single call. This value is returned by Posts sent to a kernel thread that already has a post pending against it are discarded. RETURN VALUE
returns 0 if it succeeds, -1 otherwise. returns 0 if posted, -1 otherwise. returns 0 if the post succeeds, -1 otherwise. returns 0 if every post succeeds, -1 otherwise. returns the maximum number of kernel threads that can be posted with a single call to ERRORS
sets to one of the following values if it fails: ukid points to an illegal address. The reliable detection of this error is implementation dependent. sets to one of the following values if it fails: was called with a timeout of 0 but the caller has no post(s) pending. was called with a timeout that expired. ts points to an illegal address. The reliable detection of this error is implementation dependent. was interrupted by a signal. The timespec pointed to by ts is invalid. sets to one of the following values if it fails: The ukid refers to a non-existent kernel thread. sets to one of the following values if it fails: targets points to an illegal address. The reliable detection of this error is implementation dependent. errors points to an illegal address. The reliable detection of this error is implementation dependent. count is less than 0. count exceeds the maximum value (as returned by A ukid refers to a non-existent kernel thread. postwait(2)
All times are GMT -4. The time now is 08:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy