Unix:- Remove space from the output command

Posted: December 22, 2015 in UNIX

cat yyyymmddprefixandcat.sh | wc -l
Result:- 16

Now to remove the space from the output use below
cat yyyymmddprefixandcat.sh | wc -l | tr -d ” ”

Using AWK

wc -l yyyymmddprefixandcat.sh | awk ‘{print $1}’

Result:-

16

Using CAT
cat yyyymmddprefixandcat.sh | wc -l

Result:-
16

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s