How to write an awk script that emulates the wc command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to write an awk script that emulates the wc command
# 1  
Old 03-20-2012
How to write an awk script that emulates the wc command

How to write an awk script that emulates the wc command
Thank you very much!Smilie
# 2  
Old 03-20-2012
Why?
Sounds more like a homework assignment.
# 3  
Old 03-20-2012
Yes, it is
Please show me the way to solve it. I dont mean you show the whole script.
Thank you Smilie
# 4  
Old 03-20-2012
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Write pid and command name to a txt file while executing a bash script

Hi All, Just have a requirement, I am executing a bash shell script, my requirement is to catch the pid and job name to a txt file in the same directory, is there anyway to do it? please help me out. Regards Rahul ---------- Post updated at 08:42 AM ---------- Previous update was at... (2 Replies)
Discussion started by: rahulkalra9
2 Replies

2. Shell Programming and Scripting

Write Awk output to a file , inside script.

Hi, Can anyone please help me with this issue. I have a Awk command which take file as input, and provides the output having multiple lines, its working in command mode, but not if i plug it in script. #!/bin/ksh infile=a.txt outfile=b.txt awk ' BEGIN{ FS=OFS="|";ORS = "\n";... (1 Reply)
Discussion started by: sp999
1 Replies

3. Shell Programming and Scripting

Write Command - with script

This is all on a Unix computer where I login using Putty (for references sake). I was wondering if it was possible to use the write command with an already predetermined message in mind. I'm attempting to write to another user, but I'd like to do something like: write user1 "Message" So... (2 Replies)
Discussion started by: eXist73
2 Replies

4. Shell Programming and Scripting

write awk command into file using awk

hi, i want to write my nawk command into a file. i want to write: awk 'NR==14 && $NF!="Set."{print "l ./gcsw "r" '"'"'lt all;"p"'"'"'"} NR==5{r=$2} NR==3{p=$2 FS $3 FS $4 FS $5}' $logfile > /home/gc_sw/again.mos'"'"' into gc.mos file. this is my code: awk '{print "awk 'NR==14 &&... (6 Replies)
Discussion started by: gc_sw
6 Replies

5. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

Hello all, Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val: > cat getnon0file.sh #!/bin/bash this="getnon0file.sh" USAGE=$this" InFile="xyz.38" Min="0.05" # awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies

6. Shell Programming and Scripting

How to write an at command which executes a script every month on 3 rd

Hi Any one pls give me the at command which runs 3 rd of every month at 2 am. Its urgent ...Your help would be so much for me Thanks .. (3 Replies)
Discussion started by: rxg
3 Replies

7. Shell Programming and Scripting

write a shell script to execute a command

Hello all, I have just started doing shell scripting. I want to read a file which stores the status of my job I have submitted on a cluster. The file looks something like this : ========================FILE============================= crab: Checking the status of all jobs: please wait... (4 Replies)
Discussion started by: learn_linux
4 Replies

8. UNIX for Advanced & Expert Users

anyone have a script that emulates proctree (5.2AIX)

Anyone have a script that emulates 5.2AIX proctree command? I have multiple platforms of AIX and I need to produce a proctree for versions of AIX that do not have proctree thanks! (0 Replies)
Discussion started by: A Stewart
0 Replies
Login or Register to Ask a Question