Search Results

Search: Posts Made By: MaindotC
2,347
Posted By bakunin
Use "elif". It works like this (see "man awk" for...
Use "elif". It works like this (see "man awk" for details):

if( <condition> ) {
<code>
} elif( <other condition> ) {
<code>
} ...
else {
<code>
}

You can have as many...
2,347
Posted By pamu
use else if
use
else if
Forum: Solaris 10-16-2012
1,338
Posted By jim mcnamara
iostat -E will list serial numbers for hard...
iostat -E

will list serial numbers for hard drives. This is the only way know of to tell if a disk was actually replaced with another disk. But you need to know the previous serial number. I do...
26,346
Posted By vidyadhar85
then try this :) grep "^[^|]*|AB" infile or ...
then try this :)
grep "^[^|]*|AB" infile
or
awk -F"|" '$2 ~ /AB/{print}' infile
3,212
Posted By codecaine
awk 'NF' yourfile.txt
awk 'NF' yourfile.txt
3,212
Posted By agama
Blank lines might not be empty lines (immediate...
Blank lines might not be empty lines (immediate newline), but have one or more whitespace characters between the beginning of the line and the newline. Does this help?


sed -E '/^[[:space:]]*$/...
3,212
Posted By Don Cragun
There are lots of ways to do this depending on...
There are lots of ways to do this depending on what tools you're using to process the lines that aren't empty. But, for what it looks like you're trying to do with this script, you could use:
grep...
3,212
Posted By birei
Hi MaindotC, You have a mix between the...
Hi MaindotC,

You have a mix between the selection command /.../ and substitute command s/.../.../

Use:

/^$/ d
3,212
Posted By RudiC
Pls post a hexdump/octal dump of your input file...
Pls post a hexdump/octal dump of your input file so the guessing can be replaced by analysing.
3,212
Posted By Don Cragun
OK. If you really want to get rid of blank lines...
OK. If you really want to get rid of blank lines (lines containing zero or more space and/or tab characters terminated by a newline character) rather than empty lines (lines that only contain the...
3,212
Posted By alister
For all we know, there could be control...
For all we know, there could be control characters in the data, in which case none of the solutions provided will work.

RudiC has given the best advice yet.

Regards,
Alister
3,212
Posted By methyl
@MaintdotC Yet again, please post what...
@MaintdotC
Yet again, please post what Operating System and version you are running. This really matters - expecially if it happens to be MACOS or Cygwin.

Please post sample input...
3,564
Posted By neutronscott
#!/usr/bin/awk -f #firstly bring in this...
#!/usr/bin/awk -f

#firstly bring in this systems group entries
BEGIN {
FS=OFS=":"
cmd="getent group"
while ((cmd | getline) > 0) {
...
2,533
Posted By jim mcnamara
while read i do if id $i > /dev/null 2>&1 ...
while read i
do
if id $i > /dev/null 2>&1
then
USER_LDAP_GROUPS="`id $i | cut -d\= -f4 | sed 's/([^()]*)//g;s/,/ /g'`"
echo $USER_LDAP_GROUPS
else
echo "Invalid user $i"
...
1,989
Posted By ctsgnb
Just another sed statement if your whole file is...
Just another sed statement if your whole file is formatted the same way than in your example :

sed 'N;N;s/\n/ /g' yourfile
1,989
Posted By bakunin
This is easy to explain: /:[0-9][0-9]$/N ...
This is easy to explain:

/:[0-9][0-9]$/N

This is saying apply the command (which is "N") to all lines of the form: a ":" followed by two digits at lines end. "N" combines a line with the...
1,989
Posted By jayan_jay
$ paste - - - < infile USER_ID 12/31/69...
$ paste - - - < infile
USER_ID 12/31/69 19:00:00 12/31/69 19:00:00
USER_ID 12/31/69 19:00:00 12/31/69 19:00:00
USER_ID 12/31/69 19:00:00 12/31/69 19:00:00
USER_ID 12/31/69...
14,368
Posted By DGPickett
It looks like you can put the address into the...
It looks like you can put the address into the email yourself and let sendmail pull them back out:

Man Page for sendmail (OpenSolaris Section 1m) - The UNIX and Linux Forums...
3,094
Posted By kalpeer
try %s/ /\\r/g
try
%s/ /\\r/g
3,094
Posted By Scrutinizer
Have you tried using /usr/xpg4/bin/vi instead?
Have you tried using /usr/xpg4/bin/vi instead?
3,094
Posted By gary_w
The action you describe is what I would have...
The action you describe is what I would have expected actually. You need to enter a control character so press CTRL-V which allows entry of a control character, then press enter like this:

:%s/...
1,216
Posted By ahamed101
Try this... grep -vf dont_touch_list...
Try this...

grep -vf dont_touch_list master_list > master_touch_list

--ahamed
1,216
Posted By fpmurphy
You can probably use the join utility to do what...
You can probably use the join utility to do what you want to do.

For example, if do-not-touch file contains:

a
b
c

and master-list file contains:

a
b
c
d
e
f

Assuming the files...
Forum: Solaris 10-20-2011
6,936
Posted By bartus11
Check grep mail /etc/syslog.conf
Check grep mail /etc/syslog.conf
2,132
Posted By Peasant
Since you are testing return you need to remove...
Since you are testing return you need to remove the grep process when greping :)

For instance, i will grep for nonexisting process

$ ps ax | grep mpd2 || echo "No MPD2 running"
29221 pts/6 ...
Showing results 1 to 25 of 25

 
All times are GMT -4. The time now is 06:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy