Unix script to delete file if it contains single line -


I have a file abcde.txt, which can contain one or more lines of text I want a script that removes the file Given, if there is a line in it.

Something like this, if 'wc -l abscde.txt' = 1 then rm aspc dtx

My system: Solaris < / Div>

Here is a simple bad script:

  #! / Bin / bash LINECOUNT = 'wc -l esccd.txt | | Cut -f1 -d '' `if [[$ LINECOUNT == 1]]; Then RM-F ASQTTi FI    

Comments