answersLogoWhite

0


Best Answer

#!/bin/sh

wc -lw "$1"

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a shell script which counts the number of lines and words present in a given file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a shell script which counts the last 10 lines present in a given file?

You don't need a shell script to do this - just use the 'tail' command.


What is countering?

A counter is a sequencial circuit with a set of flip flop which counts the number of pulses given at the clock input A counter is a sequencial circuit with a set of flip flop which counts the number of pulses given at the clock input


What function counts the number of cells within a range that meets the given condition?

Countif


Write a shell script to count the number of times is appears in a given text file?

You don't need a shell script to do this; use the 'grep' command with the '-c' option to count the number of occurrences of some pattern.


How can we use has as a tense?

As main verb we can use has as a simple present tense. - He has a nice car. As an auxiliary verb we can use has in present perfect. - He has bought another car. Has is used with he/she/it or a singular noun subject. She has given me her number or the girl has given me her number. We has given the dog his food.


How many chloride ions are present?

The number of chloride ions present in a given substance depends on the substance size and the type of substance.


How do find factorial using vbscript?

<html> <script language="vbscript"> n=cint(inputbox("Enter a number")) dim f f=1 if n<0 then Msgbox "Invalid number" elseif n=0 or n=1 then MsgBox "The factorial of given number "&n&" is :"&f else for i=n to 2 step -1 f=f*i next MsgBox "The factorial of given number "&n&" is :"&f end if </script> </html>


What are the names of the guards that were made drunk in Macbeth?

They are not given in the script.


What is the present perfect tense of give?

The present perfect tense of "give" is "have given".


What is a script on scratch?

Script is step wise instructions given to a sprite. For example- When green flag clicked Pen down Move 100 steps In simple language, commands given to a sprite.


A variable affected by the number of organisms present in a given area?

The density dependent factor is defined as being a variable that is affected by the number of organisms present in any given area. This information is important to many different types of scientists that are conducting research throughout the world.


The given circumstances in the script include?

*Time of day, location, period