Sponsored Content
Top Forums Shell Programming and Scripting change word in a property file Post 302500770 by glev2005 on Tuesday 1st of March 2011 12:57:24 PM
Old 03-01-2011
with sed:
Code:
sed -i 's/inspect=ON/inspect=OFF/g'

If you are running on a Mac or a version of sed that errors out on the first one then try:
Code:
sed -i .bak 's/inspect=ON/inspect=OFF/g'

In a script
Code:
#!/bin/bash
echo "What is the full path to the Inspector.Properties file?"
read file
sed -i 's/inspect=ON/inspect=OFF/g' "$file"
if [ $? -ne 0 ]; then
sed -i .bak 's/inspect=ON/inspect=OFF/g' "$file"
else
echo ""
fi
exit 0


Last edited by glev2005; 03-01-2011 at 06:32 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find a word in a file, and change a word beneath it ??

Hi all, I have a file with lines written somewhat like this. aaaa ccc aa linux browse = no xssxw cdcedc dcsdcd csdw police dwed dwd browse = no cdecec (2 Replies)
Discussion started by: vikas027
2 Replies

2. Shell Programming and Scripting

Problem printing the property of xml file via shell script

Hi, I have a config.xml which cointains the tags like <CONFIG> <PROPERTY name="port" value="1111"/> <PROPERTY name="dbname" value="ABCDE"/> <PROPERTY name="connectstring" value="xyz/pwd"/> </CONFIG> This file is in some directory at UNix box. I need to write a... (4 Replies)
Discussion started by: neeto
4 Replies

3. Shell Programming and Scripting

source a property file in script give error

I have sourced a property file in my script like this to load some variables in the script Then i am able to echo all the property file values inside script but the script is not able to recognize other unix commands #!/bin/bash . build.properties mkdir build i am getting error ... (3 Replies)
Discussion started by: codeman007
3 Replies

4. Shell Programming and Scripting

perl use property file for variables

if I have a file that contains variables. How do I assign them in a script. file p=c e=g Thanks (3 Replies)
Discussion started by: 3junior
3 Replies

5. Shell Programming and Scripting

Report a missing property and property value mis match script.

Hi All, I have 2 properties files - one is a master templete and other one is a node specific properties file, I need to comapre these 2 properties files and make sure the node Specific properties file contains all the properties in the master temple properties file else report the missing... (5 Replies)
Discussion started by: jayka
5 Replies

6. Shell Programming and Scripting

Reading a property file through shell script???

Hi! i need a script that can read a property file. i.e., A script to read a "property" from property file. Read the property value and based on value of property, decide whether to start the some dataload activity or not. Its urngent. Can anyone help me out???:( (7 Replies)
Discussion started by: sukhdip
7 Replies

7. Shell Programming and Scripting

reading and updating property file

I have to do a read operation for a field in property file, which looks like follows: 123|xyz|datetime|count '|' is delimiter. Finally I managed to read the contents of property file using statement like cut -d"|" -f1 $PROPERTIES_FILE | tr '\n' ' ' <-- Reading first column But now I... (2 Replies)
Discussion started by: rakeshranjanscs
2 Replies

8. Shell Programming and Scripting

Property file processing in unix

Hi genius, Following is the problem. We have one templete file(input file) where some variables will be used Example: word1 word2 &{word3} word4 ${word5} word6 And also we have one property file where we define these variables Example: word3= something Word5= something Need to read... (5 Replies)
Discussion started by: gjarms
5 Replies

9. UNIX for Beginners Questions & Answers

Parse property from json file

Hello All, Greetings.. I have a json file that I need to pase its URLs and other values. The match should start with "notifications" and output URLs and settings values. I tried with python or awk but hardly could get URLs only. Or whole URLs from full json file. Could not match... (2 Replies)
Discussion started by: 7adi
2 Replies
CELERYCTL(1)						      General Commands Manual						      CELERYCTL(1)

NAME
celeryinit -- Celery Management Utility SYNOPSIS
celeryinit DESCRIPTION
This manual page documents briefly the celeryinit command. This manual page was written for the Debian distribution because the original program does not have a manual page. celeryinit is a command line utility to inspect and manage worker nodes. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -q --quiet TODO --conf Celery config module name (default: celeryconfig). --loader Celery loaders module name (default: default). -C --no-color Don't colorize output. COMMANDS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. status List active nodes in this cluster. result Show the result of a task. inspect active Show all the tasks that are currently being executed. inspect scheduled Show all the tasks reserved by the worker because they have the eta or countdown argument set. inspect reserved Show all tasks that have been prefetched by the worker, and is currently waiting to be executed (does not include tasks with an eta). inspect revoked List history of revoked tasks. inspect registered_tasks List registered tasks. inspect states Show worker statistics. inspect enable_events Enable events. inspect disable_events Disable events. SEE ALSO
celeryd (1), celerybeat (1), celeryev (1). AUTHOR
This manual page was written by fladi FladischerMichael@fladi.at for the Debian system (and may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. CELERYCTL(1)
All times are GMT -4. The time now is 12:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy