try
#!/bin/bash
cd /var/www/armando.se
netstat -a | grep tcp > textfil1.txt
date +"%Y-%m-%d" >> textfil1.txt
chmod 755 textfil1.txt
where
>>
is append operatortouch
a file before crating itДругая половина вашего вопроса, удаляя только круглые скобки (, но не текст между ними):
echo 'text0 text1 text2 (text3 text4)' |
sed 's/[()]//g'
Выход:
text0 text1 text2 text3 text4