Sponsored Content
Top Forums Shell Programming and Scripting Change value in a file using perl or shell script Post 302743635 by guruprasadpr on Thursday 13th of December 2012 05:13:57 AM
Old 12-13-2012
Hi

Use your perl command like this:

Code:
$ p1="/home/mvdev/workspace/boxer"
$ p2="p2="/home/common/workspace/mirror"
$ perl -i -pne "s|$p1|$p2|;" file

Guru.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing a file handler and an array from Perl to Shell Script

Hi there, I am trying to call a shell script from a Perl script. here is the code: @args = ("sh", "someshellprg.sh", "a file handler", "an array"); system(@args) == 0 or die "system @args failed: $?"; in the shell program, I examine if the arguments exits using: if then echo... (5 Replies)
Discussion started by: pinkgladiator
5 Replies

2. Shell Programming and Scripting

how to reuse a shell script to change env from perl

Hi: I am trying to reuse an existing shell script foo1.csh to set environment variables inside a perl script and its childern processes. Is it possible at all to make those environment variables persistent in the main perl process and its children processes? Do I have to create a new... (4 Replies)
Discussion started by: phil518
4 Replies

3. UNIX for Dummies Questions & Answers

Shell script to rename or change file extension case.

I searched the forum, but there was different type of rename. Hello. I have files in folder. Like: xxxxxxxx1.html or xxxxxxxx2.txt or xxxxxxxx3.tar.gz and how to rename or change file extension case to xxxxxxxx1.htm or xxxxxxx2.TXT or (5 Replies)
Discussion started by: Sheldon
5 Replies

4. Shell Programming and Scripting

Change a line in a php file thanks to a shell script

Hi, I'm working on a script to make automatic the new releases of my website... However in this script I put all the css script in a single one. There's no rpoblem for that. My problem is when I want to change the header of my layout page to put instead of : $header.="<link rel=\"stylesheet\"... (2 Replies)
Discussion started by: lahabana
2 Replies

5. Shell Programming and Scripting

Help with shell script for know when a file change it

Hi, IŽd like to know how to program a shell script for know when a file changes and based on that make another tasks all this in real time.. Thanks (2 Replies)
Discussion started by: mrios7
2 Replies

6. Shell Programming and Scripting

shell or perl script needed for ldif file to text file conversion

This is the ldf file dn: sdcsmsisdn=1000000049,sdcsDatabase=subscriberCache,dc=example,dc=com objectClass: sdcsSubscriber objectClass: top postalCode: 29600 sdcsServiceLevel: 10 sdcsCustomerType: 14 givenName: Adelia sdcsBlackListAll: FALSE sdcsOwnerType: T-Mobile sn: Actionteam... (1 Reply)
Discussion started by: LinuxFriend
1 Replies

7. Shell Programming and Scripting

shell script to change the extension of a file

I have a directory that contains several files, out of which some files are have an extra extension for example file1.new.new.new file2.new.new.new file3.new.new.new file4.new.new.new i want to write a shell script that rename all such file with only single extension like file1.new... (7 Replies)
Discussion started by: mukulverma2408
7 Replies

8. Shell Programming and Scripting

Using variable from shell script in perl file

Hey, So I have a shell script that outputs some variables, call them $a and $b. I know in shell scripting if I wanted to use the variables in another shell script I'd do sh code.sh "$a" "$b" How can I do something similar with perl? (2 Replies)
Discussion started by: viored
2 Replies

9. Shell Programming and Scripting

Need Help:Shell Script for Solaris to change the dates in a file by one week

I have to increase the date by one week in an input when script is executed in solaris. I was able to acheive this using ksh script that is working in Linux enivironment, when i execute the same script in Solaris i am getting below error: /var/tmp\n\r-> ./script.ksh date: illegal option -- d... (3 Replies)
Discussion started by: sriramanaramoju
3 Replies

10. Shell Programming and Scripting

Shell script change new format on the file.

Hi---Is there's way can write small shell script or perl script open "abc.txt" file and create new "new_abc.txt" file with format output below? Thanks cat abc.txt ###########################Readme############################### Contained with this README.TXT file are all of the file... (7 Replies)
Discussion started by: dotran
7 Replies
DtWsmGetWorkspaceInfo(library call)									       DtWsmGetWorkspaceInfo(library call)

NAME
DtWsmGetWorkspaceInfo -- get detailed workspace information SYNOPSIS
#include <Dt/Wsm.h> int DtWsmGetWorkspaceInfo( Display *display, Window root, Atom aWorkspace, DtWsmWorkspaceInfo **ppWsInfo); DESCRIPTION
The DtWsmGetWorkspaceInfo function works with the CDE workspace manager, dtwm(1), and returns detailed information on a specific workspace. The display argument is the X display. The root argument is the root window of the screen of interest. The aWorkspace argument is the workspace name (converted to an X atom). The *ppWsInfo argument is the address of a variable to receive the returned pointer to the workspace information data. The DtWsmWorkspaceInfo structure contains at least the following members: Atom workspace The workspace name (con- verted to an X atom). unsigned long bg The pixel ID used for the background color of the backdrop. unsigned long fg The pixel ID used for the foreground color of the backdrop. Atom backdropName The backdrop file name (converted to an X atom). The file must be in either X Bitmap file format (with extension .bm) or X Pixmap file format (with extension .pm). The workspace man- agement services look for the file along the same path used for searching icons. The directory /usr/dt/backdrops is the default directory if the file cannot be found along the icon search path. int colorSetId The colorset number used for this workspace, which affects the backdrop color and the button color for this workspace on the front panel. char *pchTitle The title displayed in the button for this workspace on the front panel. This string is interpreted in the locale in which the CDE workspace manager, dtwm(1), is running. The title is different from the workspace name. The workspace name, when con- verted from an X atom, is used as the identifier for a workspace in the workspace manager function calls. The CDE workspace manager, dtwm(1). also uses the workspace name as a resource name; thus, the characters used in a workspace name are restricted to the charac- ters in the X Portable Character Set. The workspace name for a workspace created from the front panel is generated automatically by the CDE workspace manager, dtwm(1). Window *backdropWindows A pointer to an array of windows that make up the backdrop. int numBackdropWindows The number of elements in the backdropWindows array. RETURN VALUE
Upon successful completion, the DtWsmGetWorkspaceInfo function returns Success and the workspace manager returns in *ppWsInfo a pointer to a DtWsmInfo structure that contains information about the workspace aWorkspace; otherwise, it returns a value not equal to Success. APPLICATION USAGE
If the DtWsmGetWorkspaceInfo function is not successful, failure may be due to a memory allocation error or failure to find the correct workspace information (that is, the CDE workspace manager, dtwm(1), is not running). The application must use the DtWsmFreeWorkspaceInfo(3) function to free the data returned in *ppWsInfo. The *backdropWindows pointer may be useful for applications that are interested in some events on the root window. Since the backdrop covers the root window, the backdrop catches the button events before they reach the root. SEE ALSO
Dt/Wsm.h - DtWsm(5), dtwm(1), DtWsmGetWorkspaceList(3), DtWsmFreeWorkspaceInfo(3). DtWsmGetWorkspaceInfo(library call)
All times are GMT -4. The time now is 06:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy