Search Results

Search: Posts Made By: ment0smintz
1,674
Posted By Scott
^ in this context means "at the start of the...
^ in this context means "at the start of the line".

.* is nothing to do with "globbing". It's regular-expression speak for match any character (.) any number of times (*), meaning "match zero or...
2,055
Posted By pamu
Is this what you want.....? if(!(NR%2)) ...
Is this what you want.....?


if(!(NR%2)) --> it will go to even NR

else{s=$1;gsub(s,"",$0);a[s]=$0} --> When NR is odd - get $1 to "s" and store it in array with index as $1. And...
1,054
Posted By pamu
use getline to get the next line..:) awk...
use getline to get the next line..:)

awk '/TTMT/{print ;getline; print}' file
1,054
Posted By pamu
grep -E "first|second" file egrep...
grep -E "first|second" file

egrep "first|second" file

if you want both string present in one line then use

awk '/first/ && /second/' file
2,509
Posted By pamu
try this.. awk -F,...
try this..


awk -F, 'FNR==NR{a[$1]=$0;next}{if($1 in a) {print a[$1]}else{print $1",,LOGOFF"}}' OFS=, file2 file1
2,509
Posted By Chubler_XL
Oops typo in my post try: join -a 1 -t, -o...
Oops typo in my post try:

join -a 1 -t, -o 1.1 2.2 2.3 txt1 txt2

Might also have to throw a sed in if you want LOGOFF on missing lines:

join -a 1 -t, -o 1.1 2.2 2.3 txt1 txt2 | sed...
1,121
Posted By pamu
try this.. echo...
try this..

echo eqpt_list_QC_"$terminalc"T_"$readNOW"

and you can use $readTerminal directly.. no need to define another variable..

echo eqpt_list_QC_"$readTerminal"T_"$readNOW"
1,103
Posted By kshji
In the shell scripts if is also command. Looks...
In the shell scripts if is also command. Looks like if in the programming languages but it's not same.
After if is some command, example test or shortly [ or compound command [[ or even cp or ...
...
1,580
Posted By Scrutinizer
Shell version: while IFS=' ,' read label f1...
Shell version:

while IFS=' ,' read label f1 f2 f3 f4 f5 f6 f7
do
case $f1 in
Y) res=${f2}${f4}_${f6} ;;
D) res=${f3}_KIOSK ;;
P) res=$f2 ;;
G)...
1,580
Posted By pravin27
sort -k2 file2 -o file2 awk -F","...
sort -k2 file2 -o file2
awk -F"," 'NR==FNR{a[$1]++;next} {char=substr($1,length($1),1);if(a[char] ){ if (char == "Y") {
print $2,$4"_"$6} else if (char == "D") { print $3"_KIOSK" } else if (char...
2,808
Posted By pamu
try this.. sed '1,/SQL> SQL> SQL>/d'...
try this..


sed '1,/SQL> SQL> SQL>/d' file
1,040
Posted By elixir_sinari
awk -F, 'FNR==NR{a[$1]=$2;next}{$(NF+1)=($1 in...
awk -F, 'FNR==NR{a[$1]=$2;next}{$(NF+1)=($1 in a)?a[$1]:"UNDEPLOYED"}1' OFS=, file2 file1
Is this what you what?
Showing results 1 to 12 of 12

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