Sponsored Content
Full Discussion: Javascript Replace Globally
Top Forums Shell Programming and Scripting Javascript Replace Globally Post 302123937 by cbkihong on Wednesday 27th of June 2007 09:51:17 PM
Old 06-27-2007
Quote:
Originally Posted by Shell_Life
If you are lucky, you will find somebody here with Java experience.
Javascript is not Java.

The following example shows how to perform a global replace of whitespace character to "~".

Code:
var spx = /\s/g;
alert("adam smith king".replace(spx, "~"));

See:
http://developer.mozilla.org/en/docs...Objects:RegExp
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

installing globally

where is the best location in a system to install software globally for users to use. asuming your the sys admin. i know it might not matter, but just wondering. (2 Replies)
Discussion started by: savage
2 Replies

2. Solaris

How to globally change root password?

I am the new admin of about 50 or so Solaris systems (both 8 & 9) that I need to change the root (&shadow) password to after the prior admin left. Is there a tool that can be used or a script that you like to use that can be used to perform a global change to prevent having to login to each... (2 Replies)
Discussion started by: sconewb
2 Replies

3. Shell Programming and Scripting

Redirect stdout/stderr to a file globally

Hi I am not if this is possible: is it possible in bach (or another shell) to redirect GLOBALLY the stdout/stderr channels to a file. So, if I have a script script.sh cmd1 cmd2 cmd3 I want all stdout/stderr goes to a file. I know I can do: ./script.sh 1>file 2>&1 OR ... (2 Replies)
Discussion started by: islegmar
2 Replies

4. Shell Programming and Scripting

Help with Find/Replace Javascript Injected Strings in mulitple files

Hi, guys, I'm not a high-end programmer, but I've been trying to write a script to remove all of the b.rtbn2.cn (and b.adserv.cn and any future variation) injected script tags on the server. (Still working on security fixes to prevent it in the future, just need to clean up now.) My approach is... (1 Reply)
Discussion started by: zzlegs
1 Replies

5. Shell Programming and Scripting

Sed command to globally replace xth occurance.

This should replace the 1st and the 3rd occurance of "the": sed -e "s/ the / those /1;s/ the / these /3" This works only by line. If there is a second "the", but in an other line for example, it counts it as 1st again and replaces it again. How can I replace "the" 1st and 3rd... (14 Replies)
Discussion started by: lowmaster
14 Replies

6. Shell Programming and Scripting

How to declare a variable which can be accessed globally

Hi I've few shell scripts which are responsible for triggering the continuous builds for a specific module. Each shell script is for a Module. Shell script has some module specific settings in the beginning and then it triggers the builds (which are nothing but some combination of Java programs... (2 Replies)
Discussion started by: kgsrinivas
2 Replies

7. Shell Programming and Scripting

renaming files globally

I am attempting to use a shell script to append the string "AAA" to the beginning of over 400 files and I am just missing that little piece to finish. I am still a newbie and I am still learning scripting. This is what I have so far: #!/usr/bin/ksh find /home/vedder191/AAA_revised -type... (4 Replies)
Discussion started by: vedder191
4 Replies

8. UNIX for Dummies Questions & Answers

replacing a particular instance in a string globally

Hi, I'm trying to update the last two characters coming in a string globally in a file. Here is the sample data: file1 In file1, I want to have all instances replace where _o is appearing in the end of a word with _g. If _o is appearing in the middle or any other position except the... (2 Replies)
Discussion started by: er_ashu
2 Replies

9. UNIX for Beginners Questions & Answers

How to call variable inside a function globally?

Hi Gurus, Is there a way to call a variable inside a function anywhere within the script? Thanks. BR, Ernesto (2 Replies)
Discussion started by: ernesto
2 Replies
alert(3alleg4)                                                    Allegro manual                                                    alert(3alleg4)

NAME
alert - Displays a popup alert box. Allegro game programming library. SYNOPSIS
#include <allegro.h> int alert(const char *s1, *s2, *s3, const char *b1, *b2, int c1, c2); DESCRIPTION
Displays a popup alert box, containing three lines of text (s1-s3), and with either one or two buttons. The text for these buttons is passed in `b1' and `b2' (`b2' may be NULL), and the keyboard shortcuts in `c1' and `c2' as ASCII value. Example: if (!exists(CONFIG_FILE)) alert(CONFIG_FILE, "not found.", "Using defaults.", "&Continue", NULL, 'c', 0); RETURN VALUE
Returns 1 or 2 depending on which button was clicked. If the alert is dismissed by pressing ESC when ESC is not one of the keyboard short- cuts, it treats it as a click on the second button (this is consistent with the common "Ok", "Cancel" alert). SEE ALSO
alert3(3alleg4), gui_fg_color(3alleg4), exgui(3alleg4), expackf(3alleg4), exspline(3alleg4) Allegro version 4.4.2 alert(3alleg4)
All times are GMT -4. The time now is 05:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy