Search Results

Search: Posts Made By: jeffwang66
1,231
Posted By jeffwang66
Question about a awk command
Hi,

I am studying an awk command:

awk '{ sub(/\/\/.*/, "", $NF); print }' input.txt

The input.txt is:

char*s1="//hello"; //comment
//delete
/* hello //*/


The output is :
...
2,975
Posted By jeffwang66
A bash script
Hello,

I want to write a bash script to delete the content after '#'. However, if '#' appears in a string with "", ignore this. For example,

input file:

test #delete
"test #not delete"
...
1,243
Posted By jeffwang66
Question about writing a bash script
Hello,

I want to write a bash script to delete the content after '#'. However, if '#' appears in a string with "", ignore this. For example,

input file:

test #delete
"test #not delete"
...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 04:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy