Unix/Linux Go Back    

Showing results 1 to 25 of 500
Search took 0.13 seconds.
Search: Posts Made By: Don Cragun
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 6
Views: 124
Posted By Don Cragun
The two commands: cat /tmp/OutFile | egrep...

The two commands:
cat /tmp/OutFile | egrep "GAP" | awk '{print $10, $11}' | sort| uniq >> ${FILE}

cat /tmp/OutFile | egrep "DUP" | awk '{print $11, $12}' | sort| uniq >> ${FILE}
clearly can't...
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 8
Views: 213
Posted By Don Cragun
Setting FS to #|# (via direct assignment or by...

Setting FS to #|# (via direct assignment or by using the -F option) should effectively set the field separator to an octothorpe (i.e. #) on any awk based on the version of awk that Aho, Weinberger,...
Forum: Programming Linux 3 Days Ago
Replies: 3
Views: 104
Posted By Don Cragun
How did you declare these functions in your...

How did you declare these functions in your source code?

What compiler are you using?

What compiler options did you use when you compiled your source code?

What diagnostics were produced...
Forum: Shell Programming and Scripting Linux 4 Days Ago
Replies: 6
Views: 135
Posted By Don Cragun
The following produces the output requested in...

The following produces the output requested in post #1 from the two input files shown in post #1, but without a clear description explaining the logic that is supposed to be implemented, I have no...
Forum: Shell Programming and Scripting Linux 4 Days Ago
Replies: 8
Views: 144
Posted By Don Cragun
Hi MadeInGermany, Yes, you're correct. Neither...

Hi MadeInGermany,
Yes, you're correct. Neither sed -i nor sed -r are included in the standards so I seldom use either of them. I confused the meanings of -i and -r in gsed. (I mistakenly thought...
Forum: Solaris Linux 4 Days Ago
Replies: 10
Views: 182
Posted By Don Cragun
I'm not sure what you mean by saying "i boot from...

I'm not sure what you mean by saying "i boot from Sol 9 CD but the kernel is latest one"???

You cannot run a Solaris 10 or 11 kernel on a system with Solaris 9 libraries, and there is no reason to...
Forum: Shell Programming and Scripting Linux 4 Days Ago
Replies: 8
Views: 144
Posted By Don Cragun
Just to be clear, is it true that you want the...

Just to be clear, is it true that you want the output of the sed from the 1st find to be written to standard output (and not be included in the changes made to updated files) while all of the other...
Forum: Shell Programming and Scripting Linux 4 Days Ago
Replies: 5
Views: 105
Posted By Don Cragun
Try: awk 'FNR==NR {f2[tolower($3)]=$0;next}...

Try:
awk 'FNR==NR {f2[tolower($3)]=$0;next} {print ((tolower($3) in f2)?f2[tolower($3)] OFS:"") $0}' file2 file1
Forum: UNIX for Beginners Questions & Answers Linux 6 Days Ago
Replies: 3
Views: 119
Posted By Don Cragun
Nonetheless, this is a question concerning a...

Nonetheless, this is a question concerning a homework assignment and is not appropriate in this forum.

This thread is closed.

Continue any discussion on this topic in the thread Grades exercise...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 5
Views: 192
Posted By Don Cragun
I asked what version of shell you're using, but...

I asked what version of shell you're using, but you didn't provide an answer to that question. With a recent Korn shell, such as version 93u+, (which may be installed as ksh93 on AIX 7.1) you could...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 5
Views: 192
Posted By Don Cragun
What operating system are you using (including...

What operating system are you using (including release number)?

What shell are you using (including version number)?

If you have a filename like FILE_NAME_20180410, what date do you want? ...
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 9
Views: 207
Posted By Don Cragun
No! That is the output from running the command:...

No! That is the output from running the command:
./example1
Show us the output from running the command:
gcc -o example1 first.c
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 1
Views: 102
Posted By Don Cragun
Maybe! It depends. If any member of the...

Maybe! It depends.

If any member of the exec family of functions succeeds, it replaces the current process image with a new executable process. There is no return from that new image because the...
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 9
Views: 207
Posted By Don Cragun
We know that. But we have asked what output that...

We know that. But we have asked what output that command produced and you still haven't shown us that output!
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 9
Views: 207
Posted By Don Cragun
Sorry, I missed that. I was thinking that you...

Sorry, I missed that. I was thinking that you got it from running example1. :confused: What it wrong is that you can't execute source code. You have to compile it first and run the executable...
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 9
Views: 207
Posted By Don Cragun
What error messages did you get when you tried to...

What error messages did you get when you tried to compile your code? Did it complain about the symbols exexlp and prinf not being found? Did it complain about there not being any function...
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 1
Views: 102
Posted By Don Cragun
Did you notice the $2 that I marked in red in...

Did you notice the $2 that I marked in red in your script? Do you see that the test is looking for a file named by the 2nd command-line argument passed to your script?

What happens if you change...
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 4
Views: 130
Posted By Don Cragun
I think the problem is much simpler than you...

I think the problem is much simpler than you might think. Your choice of name for your code (test) is the name of a shell built-in in most shells and the name of a utility probably located in /bin...
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 4
Views: 131
Posted By Don Cragun
Hi amvip, Your requirements are still a little...

Hi amvip,
Your requirements are still a little bit ambiguous...

If there are one or more spaces before the 1st pipe symbol or after the last pipe symbol and there are no characters other than...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 14
Views: 423
Posted By Don Cragun
Have you read the various posts in this thread? ...

Have you read the various posts in this thread?

The code you are using says that comma is your field separator. With your new input file format, there are only two fields (or columns) in your...
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 3
Views: 112
Posted By Don Cragun
If you state that _ and - are word separators and...

If you state that _ and - are word separators and you want the first 5 words from the string contained in a variable; no your code cannot reliably guess at how many separators in the first 5 words...
Forum: Shell Programming and Scripting Linux 2 Weeks Ago
Replies: 3
Views: 130
Posted By Don Cragun
You could try a simple ping host before running...

You could try a simple ping host before running the scp, but there is always the chance that your Windows server will go down between the time that you run the ping and the time that you run the scp....
Forum: UNIX for Beginners Questions & Answers Linux 2 Weeks Ago
Replies: 6
Views: 198
Posted By Don Cragun
Hi akshayupadhayay, How silly, indeed. I...

Hi akshayupadhayay,
How silly, indeed.

I asked you to explain what company you're working for and the nature of the problem if this is not a homework assignment because the problem you have...
Forum: UNIX for Beginners Questions & Answers Linux 2 Weeks Ago
Replies: 3
Views: 125
Posted By Don Cragun
Because: that is the way awk is described...

Because:

that is the way awk is described to work,
there are no loops in your code to cause an input line in your file to be evaluated more than once,
if awk was designed to only process the...
Forum: UNIX for Beginners Questions & Answers Linux 2 Weeks Ago
Replies: 6
Views: 198
Posted By Don Cragun
Is this a homework assignment? Homework and...

Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework Questions forum (https://www.unix.com/homework-coursework-questions/) under special...
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 01:17 PM.