Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell programming: Search a blank

Status
Not open for further replies.

cadbilbao

Programmer
Apr 9, 2001
233
ES
Hi!

I'm creating a shell script, and I want to execute a command only if there is a blank in ${FILE}.

How could I carry it out?

if _?_?_?_ then
[command]
fi

Thank you very much.
 
try
if [ 1 = `echo ${FILE}|grep " "|wc -l|tr -d ' '` ]
then
command
fi Tony ... aka chgwhat
tony_b@technologist.com

When in doubt,,, Power out...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top