‘|:’ is built-in pipe-based data sink and faster than ‘>/dev/null’. For instance,
echo "Hello World!" >/dev/null
can be rewritten as
echo "Hello World!" |:
echo "Hello World!" >/dev/null
can be rewritten as
echo "Hello World!" |:
This blog provides some ready-made tips, tricks, tweaks & interview questions-answers on C, C++, Perl, Shell Scripting and UNIX Commands.
head -3 <FileName> | tail -2
| cut -d "," -f 2-3
or
cat
<FileName>
| sed -n '2,3p' | cut -d "," -f 2-3
or
cat
<FileName>
| awk 'NR==2,NR==3' | cut -d "," -f 2-3
x = x ^ 1; // or x ^= 1;This will change x alternately between 0 and 1.