Sponsored Content
Top Forums Shell Programming and Scripting How to remove the # char form a line? Post 302750977 by Jotne on Thursday 3rd of January 2013 02:30:31 AM
Old 01-03-2013
And if you like to program the line to remove
Code:
line=2
awk 'NR==inp {sub("^#","")} 1' inp=line infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove new line char from a string

Hi Can anyone tell me how can i remove new line character from a string. My requirement is to read a line from a file and store it to a string. read line string1=$line read line string2=$line echo $string1$string2 The result i am getting in different line. i want the output in the same... (1 Reply)
Discussion started by: sreedivia
1 Replies

2. Shell Programming and Scripting

how first char in odd line and second char in even line

Hi I m having ifconfig -a o/p like sbanlab1:ksh# ifconfig -a | egrep "flags|inet" | awk -F' ' '{print $1,$2}' lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> inet 127.0.0.1 lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> inet 127.0.0.1 bge0:... (1 Reply)
Discussion started by: tarunn.dubeyy
1 Replies

3. Shell Programming and Scripting

can I remove the first char using AWK?

Hi everyone, suppose that I have the following line: #test your knowledge can I use AWK to print the word "test" only? without the #? what should I change to this: awk '{print $1}' thanks in advance guys (2 Replies)
Discussion started by: Abdulelah
2 Replies

4. Shell Programming and Scripting

Remove char after Colon

Hi guys, This is my input 2735:<7001> 34 789 701 2 2774:<7001> 34 789 701 2 How to delete characters after colon : Including colon : too ? My output should... (3 Replies)
Discussion started by: gowrishankar05
3 Replies

5. UNIX for Dummies Questions & Answers

Remove First Char from Line in File Only if it's a comma

I have a file, I need to remove the first character of each line, but only if it's a comma. I don't want to delete any other commas in each line. Trying cat or sed but I really don't know them very well, would love some help. This removes the first comma, but it removes the first comma no... (6 Replies)
Discussion started by: Cynthia
6 Replies

6. UNIX Desktop Questions & Answers

Help me to remove junk char

I wanted to remove junk char in my csv. :mad: Input file format: "17","9986782190","0","D","2" "17","9900918331","0","D","2" "13","9986782194","0","A","2" Output file format 9986782190 9900918331 9986782194 And one more thing all the time "13"," this will be different Ex: . (2 Replies)
Discussion started by: Siddartha
2 Replies

7. Shell Programming and Scripting

Copy last third char form string

HI Input A.txt ABC907 ABC907_1B_9 ABC985 ABC985_1A_9 ABC985 ABC985_1B_9 ABC985 ABC985_1C_9 ABC05037 ABC05037_1A_9 ABC05037 ABC05037_1B_9 Base of column 2 last third char. If It is A the 1,if B then 2 If C then 3 File B.txt ABC907 ABC907_1B_9 2 ABC985 ABC985_1A_9 1 ABC985... (8 Replies)
Discussion started by: asavaliya
8 Replies

8. Shell Programming and Scripting

Remove x lines form top and y lines form bottom using AWK?

How to remove x lines form top and y lines form bottom. This works, but like awk only cat file | head -n-y | awk 'NR>(x-1)' so remove last 3 lines and 5 firstcat file | head -n-3 | awk 'NR>4' (5 Replies)
Discussion started by: Jotne
5 Replies

9. Shell Programming and Scripting

Remove only specific char on every line when exists

Hi I need to remove "|" char when it's the last char of the line. Input file: generoso|desprendido|altruista| abnegar|ceder|sacrificar| abocetado-da|esbozado| apuntado|insinuado|incompleto abocetar|esbozar|bosquejar| diseņar|delinear ------------------------ output need --- ... (11 Replies)
Discussion started by: lookoo
11 Replies

10. UNIX for Dummies Questions & Answers

Remove char if not a number

I need to write a BASH script that takes a 2 character string and removes the second character if it is not a digit e.g. If the string is numberical value >9 e.g. string1 = '34' then leave string1 = '34'. However if the string is <10 e.g. string1 = '3X' then remove the second char (which... (7 Replies)
Discussion started by: millsy5
7 Replies
giiSetEventMask(3)							GGI							giiSetEventMask(3)

NAME
giiSetEventMask, giiGetEventMask, giiAddEventMask, giiRemoveEventMask - Set the types of events queued SYNOPSIS
#include <ggi/gii.h> int giiSetEventMask(gii_input_t inp, gii_event_mask evm); gii_event_mask giiGetEventMask(gii_input_t inp); int giiAddEventMask(gii_input_t inp, gii_event_mask evm); int giiRemoveEventMask(gii_input_t inp, gii_event_mask evm); DESCRIPTION
Calling giiSetEventMask indicates to LibGII that only the types of events that match the specified event mask will be read by the applica- tion in subsequent giiEventPoll(3) or giiEventRead(3) calls. LibGII can then save time and memory by skipping checks and not allocating queues for events that will never be read out. The default mask allows all events. giiAddEventMask and giiRemoveEventMask are macros that set or delete individual bits in the bitmask. Note: giiSetEventMask is an advisory call. For correct operation, the application still needs to pass a restrictive event mask to the event reading functions. RETURN VALUE
giiSetEventMask, giiAddEventMask and giiRemoveEventMask return 0 on success or an gii-error(3) code otherwise. giiGetEventMask returns the currently set mask. SEE ALSO
gii_event_mask(3) libgii-1.0.x 2006-12-30 giiSetEventMask(3)
All times are GMT -4. The time now is 09:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy