Sponsored Content
Top Forums Shell Programming and Scripting How to Toggle Flag/Switch Value with Sed Post 302493826 by ghostdog74 on Thursday 3rd of February 2011 08:30:34 PM
Old 02-03-2011
well, if you want to toggle the string FLAG=0
Code:
$ awk -F"=" '/FLAG/{$2=!$2;print}' OFS="=" file

 

9 More Discussions You Might Find Interesting

1. Programming

How to toggle BACKSPACE/DEL function for backArrow key for terminal other than xterm?

Hi all, I've got the problem which I can't resolve with my knowledge :) For xterm terminal we have resource class XTerm*backarrowKey. If we set it to true, backspace code (ASCII 0x8) will be sent to program. We can get it using e.g. getc() function. If it is disabled getc() returns DEL(0x7F). ... (0 Replies)
Discussion started by: dmitryb
0 Replies

2. Shell Programming and Scripting

Toggle Hidden Files Mac OS X

Hi all, I have been using Ubuntu for 2 years now, and a few days ago I bought a Macbook. This is my first time using a Mac, so I have spent the better of two days learning the user interface, and configuring my Macbook. One thing I noticed is that there is no easy way to turn on and off hidden... (0 Replies)
Discussion started by: Omniwheel
0 Replies

3. Shell Programming and Scripting

Perl script to toggle through dates by week

Hi, I need help to toggle through dates on a weekly basis to be fed into a script as inputs. The format should be: yyyy/mm/dd (start) yyyy/mm/dd (end), where end date is 7 days increments. The date (start) would be input as an ARGV and would continue until current date. I can check... (2 Replies)
Discussion started by: subhap
2 Replies

4. Shell Programming and Scripting

pass variable to sed like in awk (-v switch)

hi all is possible to pass shell (bash) variable to sed like it is in awk? example: awk script is storred in awk.awk file and I am passing variable called var to this file. $ cat awk.awk {if ($5==var) print $0} so it works when i issue $ bash_var=24 $ ls -l | awk -v... (1 Reply)
Discussion started by: wakatana
1 Replies

5. Programming

toggle bit

how can I toggle all the bits of any given number using a shortest C code (5 Replies)
Discussion started by: rupeshkp728
5 Replies

6. Shell Programming and Scripting

what is the switch to let sed edit and save file

I remember there is a sed switch i can use to edit and save the file at the same time, but i cannot recall it at all. so instead of -> sed 's/A/B/' file > file-tmp -> mv file-tmp file what can i do to just let sed edit and save the "file" (4 Replies)
Discussion started by: fedora
4 Replies

7. UNIX for Dummies Questions & Answers

sed "-n" switch

Hi Guys, i'm exploring sed and failed to understand the following. Can anyone with more knowledge of this explain this better. I have to read lines 4 to 6 in a file so i used the following command : sed '4,6 p' file but the above prints all lines instead! . when i use the -n... (3 Replies)
Discussion started by: Irishboy24
3 Replies

8. UNIX for Dummies Questions & Answers

[Solved]Can anyone tell me why -H flag with sudo doesn't switch to the target user's home directory?

I have checked the man page ,which says : The -H (HOME) option sets the HOME environment variable to the homedir of the target user (root by default) as specified in passwd(5). By default, sudo does not modify HOME But I have tried below command: #... (1 Reply)
Discussion started by: Michaelw321
1 Replies

9. Shell Programming and Scripting

sed print flag

I have an input file that looks something like this: .... key1: ABC .... key2: DEF .... key1: GGG .... key2: HHH .... The row of dots represents any number of lines that don't contain the strings "key1:" or "key2:" The strings key1: and key2: will always appear alternately as in the... (8 Replies)
Discussion started by: pmennen
8 Replies
.::SWF::Button(3pm)					User Contributed Perl Documentation				       .::SWF::Button(3pm)

NAME
SWF::Button - SWF button class SYNOPSIS
use SWF::Button; $button = new SWF::Button(); $button->setUp($shape1); $button->setDown($shape2); DESCRIPTION
Creates buttons for flash movies. Buttons are controlled by various methods for visible design and triggered actions, see below: METHODS
new SWF::Button() Creates a new Button object. $button->addShape($shape, FLAG) Adds $shape to the button. Using this method is not recommended, better use addCharacter(), see next item for details. Also unlike addCharacter() this method does not return any SWF::ButtonRecord objects $buttonrecord = $button->addCharacter($character [, $flags]) Adds character $shape to the button. Valid FLAGs are: SWFBUTTON_HIT SWFBUTTON_UP SWFBUTTON_DOWN SWFBUTTON_OVER Unlike addShape() this method returns an object of SWF::ButtonRecord class. The flag states can be combined using the binary or operator. $buttonrecord = $button->setOver($shape) Shortcut for $button->addCharacter($shape, SWFBUTTON_OVER); $buttonrecord = $button->setHit($shape) Shortcut for $button->addCharacter($shape, SWFBUTTON_HIT); $buttonrecord = $button->setUp($shape) Shortcut for $button->addCharacter($shape, SWFBUTTON_UP); $buttonrecord = $button->setDown($shape) Shortcut for $button->addCharacter($shape, SWFBUTTON_DOWN); $button->addAction($action [,FLAG]) $button->setAction($action [,FLAG]) Adds $action object (see SWF::Action). Valid FLAGs are: SWFBUTTON_MOUSEUP SWFBUTTON_MOUSEOVER SWFBUTTON_MOUSEOUT SWFBUTTON_MOUSEDOWN SWFBUTTON_DRAGOVER SWFBUTTON_DRAGOUT SWFBUTTON_MOUSEUP is the default value of FLAG. $button->setMenu(0|1) Parameter is 0 (off) or 1(on). Can be used for a slight different behavior of buttons. $soundinstance = $button->addSound($sound, $flags) Plays a prepared SWF::Sound object and returns an object of SWF::SoundInstance. Once more valid flags are: SWFBUTTON_MOUSEUP SWFBUTTON_MOUSEOVER SWFBUTTON_MOUSEOUT SWFBUTTON_MOUSEDOWN For example: $sound = new SWF::Sound("wow.mp3", SWF_SOUND_MP3_COMPRESSED ); $soundinstance = $button->addSound($sound, SWFBUTTON_MOUSEDOWN ); $button->setScalingGrid($x, $y, $w, $h) This function (available from SWF>=8) sets a 9 slice scaling grid: 1 2 3 4 5 6 7 8 9 X, y, w and h define a rectangle, which is the dimension of the center slice(5). All other slices are determined out of the characters bounds and the defined rect. While slice 5 is scaled vertical and horizontal, slice 2 and 8 are only scaled horizontal. Slice 4 and 6 only vertical. The 4 corner slices are not scaled (1, 3, 7, 9). $button->removeScalingGrid() Removes scaling grid rectangles. AUTHOR
wrapper written by Soheil Seyfaie (soheil at users dot sourceforge dot net) Peter Liscovius (peterdd at users dot sourceforge dot net) and many others. SEE ALSO
SWF, SWF::Action, SWF::Shape, SWF::Movie, SWF::MovieClip, SWF::Constants, SWF::Sound, SWF::SoundInstance perl v5.14.2 2011-10-26 .::SWF::Button(3pm)
All times are GMT -4. The time now is 01:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy