Search Results

Search: Posts Made By: juzz4fun
1,835
Posted By juzz4fun
It seems some sort of school exercise.
It seems some sort of school exercise.
1,835
Posted By juzz4fun
If the data in the file is as it is, then below...
If the data in the file is as it is, then below might work:

cut -f2,3 -d':' infile

thanks
1,835
Posted By juzz4fun
What have you tried so far?
What have you tried so far?
2,017
Posted By juzz4fun
Hi, From what I understand, you want to print...
Hi,
From what I understand, you want to print first column whenever there are exactly two "M"s in 2nd, 3rd, 4th and 5th columns combined. If that is the case (and file is tab delimited), I would...
5,340
Posted By juzz4fun
I would create a korn shell script as below, and...
I would create a korn shell script as below, and then pass file1 and file2 as parameters to it:

#!/bin/ksh
infile1=$1
infile2=$2
for name in $(cat ${infile1})
do
egrep ${name} ${infile2} >...
3,267
Posted By juzz4fun
You may try: sed -n '/^machine/p;/^Owner/p'...
You may try:

sed -n '/^machine/p;/^Owner/p' infile

thanks
1,440
Posted By juzz4fun
Same issue when using double quotes ("Hi...
Same issue when using double quotes ("Hi Hello")?
4,516
Posted By juzz4fun
Apart from commands df and mount, I don't know...
Apart from commands df and mount, I don't know much.... specially using these commands for multiple servers. :(
1,051
Posted By juzz4fun
Thanks a ton, JustIce and bakunin ... you are...
Thanks a ton, JustIce and bakunin ... you are superb !
7
awk
1,806
Posted By juzz4fun
Nothing like that :D Thanks for correcting me...
Nothing like that :D
Thanks for correcting me...
1,051
Posted By juzz4fun
Which assignment syntax to use when?
Hi,

Lately, I have seen 2-3 variable assignment commands - set, setenv, export. What is the difference between them? Which one to use when? Really appreciate for the help...

regards,...
7
awk
1,806
Posted By juzz4fun
To get desired output...
To get desired output (CHS_26_9x3_2(26.9,3.2,2.38,1.7),), you can use Scrutinizer's solution and pass it through pipe (|) to sed 's/\./_/2' to replace first two instances of . with _ :)
22,193
Posted By juzz4fun
when I write all grep, sed, awk, sort commands in...
when I write all grep, sed, awk, sort commands in one line, instead of using \ to extend them in the next line, set var=`myScript` works very well...

---------- Post updated at 04:25 PM ----------...
22,193
Posted By juzz4fun
I understand that... even I don't like csh.. :( ...
I understand that... even I don't like csh.. :(
but the thing is that I am modifying an existing shell script....which was primarily written for csh... this is very huge script... am working on a...
2,214
Posted By juzz4fun
if you don't want space as default field...
if you don't want space as default field separator, you can define one using OFS
BEGIN{FS=OFS=","} or awk -F, '{.......}' OFS=\, input
22,193
Posted By juzz4fun
Invalid null command error
Hi,

I have this script which gives me output as Invalid null command

set recent_file=`grep '^-.*xlsx$' $FTP_LOG |\
sed -e 's/Jan/1/g' \
...
3,427
Posted By juzz4fun
My apologies... It is SunOS...and using ksh... ...
My apologies...
It is SunOS...and using ksh...
Sorry there is no GNU :(

---------- Post updated 06-19-13 at 10:32 AM ---------- Previous update was 06-18-13 at 07:17 PM ----------

I assume...
3,427
Posted By juzz4fun
FTP command to get most recent file
Hello Experts...
dir of FTP will list all the files in the directory. Is there any command or option of dir that will give me the most recent file only?
Since I couldn't find any such thing, I...
1,211
Posted By juzz4fun
same as Pamu suggested... awk...
same as Pamu suggested...

awk 'BEGIN{FS=OFS="|"}$2!~/SUPP1/ && $2 ~/[0-9]/{$16=$17=0}1' file
3,282
Posted By juzz4fun
can't you copy/paste the character itself??
can't you copy/paste the character itself??
4,527
Posted By juzz4fun
What have you tried so far? Also, specify the...
What have you tried so far?
Also, specify the input output files (at least samples, if files are big)
1,158
Posted By juzz4fun
use sort on file ---------- Post updated at...
use sort on file

---------- Post updated at 05:15 PM ---------- Previous update was at 05:15 PM ----------

oops...sorry... RudiC has already replied...
3,400
Posted By juzz4fun
Yoda: Why I get different answers when I use your...
Yoda: Why I get different answers when I use your script and my script below:

awk 'NR>1{a+=$4;b++}END{print "Average: " a/b}' file[123]

I get 41.905 with your script and 35.9186 using my...
3,400
Posted By juzz4fun
You mean you want to calculate average of 4th...
You mean you want to calculate average of 4th column in every file?
You can use below on every file...

awk 'NR>1{a+=$4;b++}END{print "Average: " a/b}' file
1,326
Posted By juzz4fun
Apologies ! I was looking at old passwd...
Apologies !
I was looking at old passwd file.... new file does contain the required information...
Thanks everyone...
Showing results 1 to 25 of 127

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