Search Results

Search: Posts Made By: u20sr
Forum: Solaris 01-05-2016
3,008
Posted By neutronscott
From the manual: Cmnd_Alias SHELLS =...
From the manual:


Cmnd_Alias SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh,\
/usr/local/bin/tcsh, /usr/bin/rsh,\
/usr/local/bin/zsh

%wheel ALL = ALL, !SHELLS


This should help...
2,249
Posted By RavinderSingh13
Hello, Some more approaches. echo...
Hello,

Some more approaches.


echo "Start: 12345 is used by PID:11111 username" | grep -Po '(?<=PID:).*'
11111 username



echo "Start: 12345 is used by PID:11111 username" | sed...
2,249
Posted By Akshay Hegde
One way $ echo "Start: 12345 is used by...
One way

$ echo "Start: 12345 is used by PID:11111 username" | awk -F":" '/PID/{print $2}' RS=" "
11111

$ echo "Start: 12345 is used by PID:11111 username" | awk 'gsub(/.*PID:|username/,x)'...
1,224
Posted By Akshay Hegde
Modify this according to your need, please use...
Modify this according to your need, please use search option before posting

Change the vertical logs to horizontal line by Akshay Hegde - Shell Programming and Scripting - Unix Linux Forums...
9,776
Posted By RudiC
Try for ( k in CMP ) ...
Try for ( k in CMP )
{printf "%13s\t", (k==v)?k:""
if ( CMP[k] == SRC[v] )
printf "%+13s\t%s\n",k,CMP[k]
}
9,776
Posted By Akshay Hegde
modify else if ( CMP[k] == SRC[v] ) ...
modify
else if ( CMP[k] == SRC[v] )
printf "%+13s\t%s\n",k,CMP[k]Separators were missing
9,776
Posted By Yoda
Yes, there is no need to initialize variable: v ...
Yes, there is no need to initialize variable: v

It is a special kind of for statement for scanning an array (http://www.gnu.org/software/gawk/manual/html_node/Scanning-an-Array.html).
9,776
Posted By Yoda
Here is an example performing array value...
Here is an example performing array value comparison.
awk '
BEGIN {
SRC["102030"] = "BEE77DA5BE9F24FBE044002128B2E77C"
CMP["102030"] =...
2,185
Posted By Don Cragun
Here is a fully commented version of the script: ...
Here is a fully commented version of the script:
awk -F= ' # Set field separator to "="
# 1st two input files consist of pairs of lines using the format:
# name=user
#...
2,185
Posted By Don Cragun
Your requirements are still ambiguous. The...
Your requirements are still ambiguous. The following awk script puts a name found in File1 into one of four files:

in no_results.out if the name does not appear in File2 and does not appear in...
2,185
Posted By Yoda
Try using this awk program instead: awk ' ...
Try using this awk program instead:
awk '
BEGIN {
F = "file1"
while (( getline line < F ) > 0 )
{
A1[line]
...
1,938
Posted By Subbeh
this should work: awk -F=...
this should work:

awk -F= 'NR==FNR{n=$2;getline;a[n]=$2;next}{print a[$1]}' file2 file1
Showing results 1 to 12 of 12

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