Sponsored Content
Full Discussion: SED on multiple files
Top Forums UNIX for Dummies Questions & Answers SED on multiple files Post 302391533 by luft on Monday 1st of February 2010 04:08:08 PM
Old 02-01-2010
SED on multiple files

Hello all,

Search & replace works fine using sed on a single file.

Ex:
sed -i 's/day/night/g' test1.sh

There are many *.sh files in my current directory that I would like use sed on. I tried running the sed command using wild card but it did not work.

sed -i 's/day/night/g' *.sh

Any ideas?

Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed across multiple files

I've got a bunch of files (40 or so) and in each there is a substitution I need to perform. I execuet the following sed command but it just make the changes to the screen without affecting the original file. sed "s/, LA/,LA/g" * (All files in the directory need this update). So I tried... (4 Replies)
Discussion started by: peter.herlihy
4 Replies

2. Shell Programming and Scripting

how to use multiple files in sed with w command

i have a command like : sed -n 's/^* /&/w even' <file if i want to write to multiple files like sed -n 's/^* /&/w zero two three' < file its not working it is taking "zero two three" as a single file i want to write to 3 seperate files . pls can anyone help me (2 Replies)
Discussion started by: santosh1234
2 Replies

3. UNIX for Dummies Questions & Answers

sed on multiple files?

Hi, I want to do a search and replace on multiple text files. Can I use sed to do this? i.e. I want to do something like: $ sed *.html -e 's/<\/body>/<\!-- blah -->\n<\/body>/' | grep -1 body ... then pipe/ channel the results back into the same files that were searched. how would... (2 Replies)
Discussion started by: mgrahamnz
2 Replies

4. UNIX for Dummies Questions & Answers

best method of replacing multiple strings in multiple files - sed or awk? most simple preferred :)

Hi guys, say I have a few files in a directory (58 text files or somthing) each one contains mulitple strings that I wish to replace with other strings so in these 58 files I'm looking for say the following strings: JAM (replace with BUTTER) BREAD (replace with CRACKER) SCOOP (replace... (19 Replies)
Discussion started by: rich@ardz
19 Replies

5. Shell Programming and Scripting

SED command using multiple input files

What is the syntax to use multiple input files in a SED command. i.e. substitute a word with a phrase in every file in a directory. for every file in /usr/include that has the word "date" in the file grep -l '\<date\>' /usr/include/*.h find each occurrence of the word "time" in the file &... (3 Replies)
Discussion started by: sheoguey
3 Replies

6. Shell Programming and Scripting

Help with Shell Scripts Using sed in multiple files.

Hi, I was hoping that someone could help me. I have a problem that i am trying to work on and it requires me to change text within multiple files using sed. I use the program to change an occurance of a word throughout different files that are being tested. At first i had to Create a new script,... (1 Reply)
Discussion started by: Johnny2518
1 Replies

7. Homework & Coursework Questions

Help with Shell Scripts Using sed in multiple files.

Hi, I was hoping that someone could help me. I have a problem that i am trying to work on and it requires me to change text within multiple files using sed. What i have so far is !/bin/sh File1="$3" File2="$4" File3="$5" testNum="$File1" while test "$testNum" <= "$File3"; do echo... (12 Replies)
Discussion started by: Johnny2518
12 Replies

8. Homework & Coursework Questions

Shell Script to sed with Multiple Files

I am not sure what I am doing wrong here. The code should work fine. I have been making small changes insuring that each new bit works. Now running my sed through multiple files I am getting incorrect output. Any help and instruction would be greatly appreciated. The problem - Generalize... (10 Replies)
Discussion started by: Lycopene
10 Replies

9. Shell Programming and Scripting

sed parser behaving strange on replacing multiple words in multiple files

I have 4000 files like $cat clus_grp_seq10_g.phy 18 1002 anig_OJJ65951_1 ATGGTTTCGCAGCGTGATAGAGAATTGTTTAGGGATGATATTCGCTCGCGAGGAACGAAGCTCAATGCTGCCGAGCGCGAGAGTCTGCTAAGGCCATATCTGCCAGATCCGTCTGACCTTCCACGCAGGCCACTTCAGCGGCGCAAGAAGGTTCCTCG aver_OOF92921_1 ... (1 Reply)
Discussion started by: sammy777888
1 Replies

10. Shell Programming and Scripting

Using sed to edit multiple files

Created a shell script to invoke sed to edit multiple files, but am missing something. Here's the shell script: oracle:$ cat edit_scripts.sh #!/bin/sh #------------------------------------------------------------------------------ # edit_scripts.sh # # This script executes sed to make global... (4 Replies)
Discussion started by: edstevens
4 Replies
CALENDAR_CONF(5)					   Sun Grid Engine File Formats 					  CALENDAR_CONF(5)

NAME
calendar_conf - Sun Grid Engine calendar configuration file format DESCRIPTION
calendar_conf reflects the format of the Sun Grid Engine calendar configuration. The definition of calendars is used to specify "on duty" and "off duty" time periods for Sun Grid Engine queues on a time of day, day of week or day of year basis. Various calendars can be imple- mented and the appropriate calendar definition for a certain class of jobs can be attached to a queue. calendar_conf entries can be added, modified and displayed with the -Acal, -acal, -Mcal, -mcal, -scal and -scall options to qconf(1) or with the calendar configuration dialog of the graphical user interface qmon(1). Note, Sun Grid Engine allows backslashes () be used to escape newline ( ewline) characters. The backslash and the newline are replaced with a space (" ") character before any interpretation. FORMAT
calendar_name The name of the calendar to be used when attaching it to queues or when administering the calendar definition. See calendar_name in sge_types(1) for a precise definition of valid calendar names. year The queue status definition on a day of the year basis. This field generally will specify on which days of a year (and optionally at which times on those days) a queue, to which the calendar is attached, will change to a certain state. The syntax of the year field is defined as follows: year:= { NONE | year_day_range_list=daytime_range_list[=state] | year_day_range_list=[daytime_range_list=]state | state} Where o NONE means, no definition is made on the year basis o if a definition is made on the year basis, at least one of year_day_range_list, daytime_range_list and state always have to be present, o all day long is assumed if daytime_range_list is omitted, o switching the queue to "off" (i.e. disabling it) is assumed if state is omitted, o the queue is assumed to be enabled for days neither referenced implicitly (by omitting the year_day_range_list) nor explicitly and the syntactical components are defined as follows: year_day_range_list := {yearday-yearday|yearday},... daytime_range_list := hour[:minute][:second]- hour[:minute][:second],... state := {on|off|suspended} year_day := month_day.month.year month_day := {1|2|...|31} month := {jan|feb|...|dec|1|2|...|12} year := {1970|1971|...|2037} week The queue status definition on a day of the week basis. This field generally will specify on which days of a week (and optionally at which times on those days) a queue, to which the calendar is attached, will change to a certain state. The syntax of the week field is defined as follows: week:= { NONE | week_day_range_list[=daytime_range_list][=state] | [week_day_range_list=]daytime_range_list[=state] | [week_day_range_list=][daytime_range_list=]state} ... Where o NONE means, no definition is made on the week basis o if a definition is made on the week basis, at least one of week_day_range_list, daytime_range_list and state always have to be present, o every day in the week is assumed if week_day_range_list is omitted, o syntax and semantics of daytime_range_list and state are identical to the definition given for the year field above, o the queue is assumed to be enabled for days neither referenced implicitly (by omitting the week_day_range_list) nor explicitly and where week_day_range_list is defined as week_day_range_list := {weekday-weekday|weekday},... week_day := {mon|tue|wed|thu|fri|sat|sun} with week_day ranges the week_day identifiers must be different. SEMANTICS
Successive entries to the year and week fields (separated by blanks) are combined in compliance with the following rule: o "off"-areas are overridden by overlapping "on"- and "suspended"-areas and "suspended"-areas are overridden by "on"-areas. Hence an entry of the form week 12-18 tue=13-17=on means that queues referencing the corresponding calendar are disabled the entire week from 12.00-18.00 with the exception of Tuesday between 13.00-17.00 where the queues are available. o Area overriding occurs only within a year/week basis. If a year entry exists for a day then only the year calendar is taken into account and no area overriding is done with a possibly conflicting week area. o the second time specification in a daytime_range_list may be before the first one and treated as expected. Thus an entry of the form year 12.03.2004=12-11=off causes the queue(s) be disabled 12.03.2004 from 00:00:00 - 10:59:59 and 12:00:00 - 23:59:59. EXAMPLES
(The following examples are contained in the directory $SGE_ROOT/util/resources/calendars). o Night, weekend and public holiday calendar: On public holidays "night" queues are explicitly enabled. On working days queues are disabled between 6.00 and 20.00. Saturday and Sun- day are implicitly handled as enabled times: calendar_name night year 1.1.1999,6.1.1999,28.3.1999,30.3.1999- 31.3.1999,18.5.1999-19.5.1999,3.10.1999,25.12.1999,26 .12.1999=on week mon-fri=6-20 o Day calendar: On public holidays "day"-queues are disabled. On working days such queues are closed during the night between 20.00 and 6.00, i.e. the queues are also closed on Monday from 0.00 to 6.00 and on Friday from 20.00 to 24.00. On Saturday and Sunday the queues are disabled. calendar_name day year 1.1.1999,6.1.1999,28.3.1999,30.3.1999- 31.3.1999,18.5.1999-19.5.1999,3.10.1999,25.12.1999,26 .12.1999 week mon-fri=20-6 sat-sun o Night, weekend and public holiday calendar with suspension: Essentially the same scenario as the first example but queues are suspended instead of switching them "off". calendar_name night_s year 1.1.1999,6.1.1999,28.3.1999,30.3.1999- 31.3.1999,18.5.1999-19.5.1999,3.10.1999,25.12.1999,26 .12.1999=on week mon-fri=6-20=suspended o Day calendar with suspension: Essentially the same scenario as the second example but queues are suspended instead of switching them "off". calendar_name day_s year 1.1.1999,6.1.1999,28.3.1999,30.3.1999- 31.3.1999,18.5.1999-19.5.1999,3.10.1999,25.12.1999,26 .12.1999=suspended week mon-fri=20-6=suspended sat-sun=suspended o Weekend calendar with suspension, ignoring public holidays: Settings are only done on the week basis, no settings on the year basis (keyword "NONE"). calendar_name weekend_s year NONE week sat-sun=suspended SEE ALSO
sge_intro(1), sge__types(1), qconf(1), queue_conf(5). COPYRIGHT
See sge_intro(1) for a full statement of rights and permissions. SGE 6.2u5 $Date$ CALENDAR_CONF(5)
All times are GMT -4. The time now is 02:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy