Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see:
viewtopic.php?t=158230
Programming languages, Coding, Executables, Package Creation, and Scripting.
hack3rcon
Posts: 746 Joined: 2015-02-16 09:54
Has thanked: 48 times
#1
Post
by hack3rcon » 2020-10-28 09:30
Hello,
I have a lot of names with Date characters front of them:
Code: Select all
Char1 2020-10-28
Char2 2020-10-28
Char3 2020-10-28
Char4 2020-10-16
Char5 2020-10-28
Char6 2020-10-26
I want to have a Bash script that remove all these dates.
Thank you.
Bloom
df -h | grep > 90TiB
Posts: 505 Joined: 2017-11-11 12:23
Been thanked: 26 times
#2
Post
by Bloom » 2020-10-28 10:44
If data.txt contains your data, just do:
If you want to save the output, add '
>newfile.txt ' after data.txt.
hack3rcon
Posts: 746 Joined: 2015-02-16 09:54
Has thanked: 48 times
#3
Post
by hack3rcon » 2020-11-03 12:03
Bloom wrote: If data.txt contains your data, just do:
If you want to save the output, add '
>newfile.txt ' after data.txt.
Not worked.
Bloom
df -h | grep > 90TiB
Posts: 505 Joined: 2017-11-11 12:23
Been thanked: 26 times
#4
Post
by Bloom » 2020-11-03 12:48
If in front of the dates, a tab is present, replace the -d " " by -d\t or remove the option (tab is the default separator for cut).
hack3rcon
Posts: 746 Joined: 2015-02-16 09:54
Has thanked: 48 times
#5
Post
by hack3rcon » 2020-11-03 17:52
Bloom wrote: If in front of the dates, a tab is present, replace the -d " " by -d\t or remove the option (tab is the default separator for cut).
Thank you.
It was a tab and
solve it.