I need to replace the line containing "STAGE_DB" with the line
"STAGE_DB $DB # database that contains the table being loaded ($workingDB)"
Here $DB is passed during the runtime.
How can I do this?
Thanks,
Kousikan (2 Replies)
New to sed...
Have a file foo.txt (below).
Need to replace text on 2 lines, but can only feed sed the first few characters of each line (all lines are unique).
So, in my example, I have put '$' in place of what I need to figure out how to feed the whole line.
What I have thus far:
sed -e... (6 Replies)
Hi,
I am looking for any script which can do the following.
have to read a pattern from fileA and copy it to fileB.
fileA:
...
...
Header
...
...
..p1
...
...
fileB:
....
....
Header (3 Replies)
I have a pattern
username:x:32005:32006::/usr/local/user:/bin/bash
I need to match the line containing username and replace /bin/bash with /usr/local/my/bin/noshell
So it becomes
username:x:32005:32006::/usr/local/user:/usr/local/my/bin/noshell (7 Replies)
I have a file with multiple lines like this:
<junk><PATTERN><junk><PATTERN><junk>
<junk><PATTERN><junk><PATTERN><junk><PATTERN><junk>
Note that
1. There might be variable number occurrences of PATTERN in a line.
2. <> are just placeholders, they do not form part of the pattern.
I need... (4 Replies)
Sed replace using same pattern repeating multiple times in a line
I have text like below in a file:
I am trying to replace the above line to following
How can I acheive this?
I am able to do it if the occurrence is for 1 time:
But If I try like below
I am getting like this:
I have to... (4 Replies)
awk , sed Experts,
I want to remove first and last line after pattern match "vg" :
I am trying : # sed '1d;$d' works fine , but where the last line is not having vg entry it is deleting one line of data.
- So it should check for the pattern vg if present , then it should delete the line ,... (5 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any... (5 Replies)
Discussion started by: Wes Kem
5 Replies
LEARN ABOUT SUNOS
calendar
calendar(1) User Commands calendar(1)NAME
calendar - reminder service
SYNOPSIS
calendar [-]
DESCRIPTION
The calendar utility consults the file calendar in the current directory and writes lines that contain today's or tomorrow's date anywhere
in the line to standard output. Most reasonable month-day dates such as Aug. 24, august 24, 8/24, and so forth, are recognized, but not 24
August or 24/8. On Fridays and weekends "tomorrow" extends through Monday. calendar can be invoked regularly by using the crontab(1) or
at(1) commands.
When the optional argument - is present, calendar does its job for every user who has a file calendar in his or her login directory and
sends them any positive results by mail(1). Normally this is done daily by facilities in the UNIX operating system (seecron(1M)).
If the environment variable DATEMSK is set, calendar will use its value as the full path name of a template file containing format strings.
The strings consist of conversion specifications and text characters and are used to provide a richer set of allowable date formats in dif-
ferent languages by appropriate settings of the environment variable LANG or LC_TIME; see environ(5). Seestrftime(3C) for the list of
allowable conversion specifications.
EXAMPLES
Example 1: Possible contents of a template
The following example shows the possible contents of a template:
%B %eth of the year %Y
%B represents the full month name, %e the day of month and %Y the year (4 digits).
If DATEMSK is set to this template, the following calendar file would be valid:
March 7th of the year 1989 <Reminder>
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of calendar: LC_CTYPE, LC_TIME, LC_MES-
SAGES, NLSPATH, and TZ.
EXIT STATUS
0 Successful completion.
>0 An error occurred.
FILES
/etc/passwd system password file
/tmp/cal* temporary files used by calendar
/usr/lib/calprog program used to determine dates for today and tomorrow
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
SEE ALSO at(1), crontab(1), mail(1), cron(1M), ypbind(1M), strftime(3C), attributes(5), environ(5)NOTES
Appropriate lines beginning with white space will not be printed.
Your calendar must be public information for you to get reminder service.
calendar's extended idea of ``tomorrow'' does not account for holidays.
The - argument works only on calendar files that are local to the machine; calendar is intended not to work on calendar files that are
mounted remotely with NFS. Thus, `calendar -' should be run only on diskful machines where home directories exist; running it on a disk-
less client has no effect.
calendar is no longer in the default root crontab. Because of the network burden `calendar -' can induce, it is inadvisable in an environ-
ment running ypbind(1M) with a large passwd.byname map. If, however, the usefulness of calendar outweighs the network impact, the super-
user may run `crontab -e' to edit the root crontab. Otherwise, individual users may wish to use `crontab -e' to edit their own crontabs to
have cron invoke calendar without the - argument, piping output to mail addressed to themselves.
SunOS 5.10 1 Feb 1995 calendar(1)