int i;
cout << "hello!" << endl;
printf("%s", "hello");
printf("%s", "world");
int i;
// cout << "hello!" << endl;
// printf("%s", "hello");
printf("%s", "world");
sed -r "2,3s/(.*)/\/\/\1/g" test.txt
func()
{
cat <<EOF
int i;
cout << "hello!" << endl;
printf("%s", "hello");
printf("%s", "world");
EOF
}
func
func | sed '/hello/ s%^%//%'
[guest@localhost sh]$ func()
> {
> cat <<EOF
> int i;
> cout << "hello!" << endl;
> printf("%s", "hello");
> printf("%s", "world");
> EOF
> }
[guest@localhost sh]$
[guest@localhost sh]$ func
int i;
cout << "hello!" << endl;
printf("%s", "hello");
printf("%s", "world");
[guest@localhost sh]$
[guest@localhost sh]$ func | sed '/hello/ s%^%//%'
int i;
// cout << "hello!" << endl;
// printf("%s", "hello");
printf("%s", "world");
[guest@localhost sh]$