Sponsored Content
Top Forums Shell Programming and Scripting Change value in a file using perl or shell script Post 302743599 by amvarma77 on Thursday 13th of December 2012 04:33:12 AM
Old 12-13-2012
Change value in a file using perl or shell script

hi,

I have a local.conf file which has the first line

TOPDIR = "/home/mvdev/workspace/boxer". I want to replace the value to
"/home/common/workspace/mirror". I tried the following perl command that is

Code:
perl -p -i -e 's/Path/path1/g' myfile.txt

then

Code:
sed '/home/mvdev/workspace/boxer/c \> /home/common/workspace/mirror' local.conf

It did not work. Can you help.

Thnx

amvarma
 

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
STRUT(1p)						User Contributed Perl Documentation						 STRUT(1p)

NAME
strut - command line interface (using Socialtext::Resting) to the Socialtext REST services SYNOPSIS
strut help strut configure strut list_workspaces strut list_pages <workspace> strut get_page <workspace> <pagename> strut set_page <workspace> <pagename> <filename> strut list_tags <workspace> <pagename> strut put_tag <workspace> <pagename> <tag> strut set_tags <workspace> <pagename> <tags> strut list_tagged_pages <workspace> <tag> strut list_attachments <workspace> <pagename> strut get_attachment <workspace> <pagename> <attachment> strut add_attachment <workspace> <pagename> <filename> strut show_breadcrumbs <workspace> strut show_backlinks <workspace> <pagename> strut show_frontlinks <workspace> <pagename> All list operations can further be controlled with the following operations: --query (search term for within the results) --filter (filter the titles of the results) --order (only accepts 'newest' right now) --count (restrict number of returned results) --accept (for your accept headers - text/html, text/plain, application/json) Example: strut --query=searchterm --filter=titlefilter --order=newest --count=number list_pages myworkspace COMMANDS
The following commands are supported help Standard man page for this program configure Configure strut with username, password, and server information. See the CONFIGURATION section below for a discussion of your configuration options. show_breadcrumbs Get the breadcrumbs for the current user in this workspace. list_workspaces Give a list of all workspaces on the server list_workspace_tags <workspace> List the tags for a workspace. list_pages <workspace> Give a list of all pages in the given workspace. If no workspace is given you will be prompted to pick from available workspaces. list_tagged_pages <workspace> Give a list of all pages in the given workspace with the given tag. get_page <workspace> <page_name> Retrieve the contents of the specified page. If no workspace or page are given the user will be prompted to select from the available workspaces/pages. set_page <workspace> <page_name> <filename> Save the specified page on the system. add_attachment <workspace> <page_name> <filename> Add the attachment to the specified page on the system. list_attachments <workspace> <page_name> List all attachments on the specified page. list_pagetags <workspace> <page_name> List all tags on the specified page. show_backlinks <workspace> <page_name> Show backlinks to the specified page name. show_frontlinks <workspace> <page_name> Show frontlinks to the specified page name. put_tag <workspace> <page_name> <tag> Add the specified tag to the specified page name. set_tags <workspace> <page_name> <tags> Set the tags for the specified page name. CONFIGURATION
In order to run correctly, strut needs to have a username, password, and server name. This can be configured in one of several ways: Command line: strut --username <username> --password <password> --server <server> Environment variables: STRUT_USERNAME STRUT_PASSWORD STRUT_SERVER Configuration file: ~/.app/strut.conf If strut can't determine your username/password/server, it will call the 'configure' subcommand to create a configuration file for you. AUTHORS
<chris.dent@socialtext.com> <kirsten.jones@socialtext.com> perl v5.14.2 2012-04-23 STRUT(1p)
All times are GMT -4. The time now is 06:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy