View previous topic :: View next topic |
Author |
Message |
orphius New Member
Joined: 25 Sep 2025 Posts: 9
|
Posted: Wed Nov 25, 2025 9:26 am Post subject: convert scroll to single line???? |
|
|
I would love to know how to convert the output of clamav from scroll to a single line readout. Any and all help would be appreciated. By the way I am wanting to do this in bash.
_________________ ArchLinux x86_64
|
|
Back to top |
|
exiled Jr. Member

Joined: 24 Nov 2025 Posts: 51 Location: ~/
|
Posted: Wed Nov 25, 2025 2:15 pm Post subject: |
|
|
You were kind of vague with that request, so I'll assume you want the total output on one line. If this is the case...
Code: | one_line=`clamscan -r /`
#substitute (clamscan -r /) with your clamscan command
echo -ne $one_line |
Not sure if this is what you want, but it will put the total output as a single line. (basically removing the \n newline characters)
_________________ Currently: Frugalware, Fedora
Previously: Gentoo, Startcom, Debian, Sabayon, Mint, openSUSE, Mangaka Chu, #!CrunchBang
|
|
Back to top |
|
Lord.DragonFly.of.Dawn Advanced Member

Joined: 18 Jul 2025 Posts: 607 Location: South Portland, Maine, USA, Earth, Sol System
|
|
Back to top |
|
orphius New Member
Joined: 25 Sep 2025 Posts: 9
|
Posted: Wed Nov 25, 2025 4:25 pm Post subject: |
|
|
sorry but none of those worked. I will try to explain better.
What i want is the output is on one line, changing with each file scanned. Not sure if it will help
but antivir scan used to do this. I'm not explaining well.
_________________ ArchLinux x86_64
|
|
Back to top |
|
Lord.DragonFly.of.Dawn Advanced Member

Joined: 18 Jul 2025 Posts: 607 Location: South Portland, Maine, USA, Earth, Sol System
|
Posted: Wed Nov 25, 2025 4:47 pm Post subject: |
|
|
alright then. I'm going to need examples since the words alone aren't quite working.
What is the output looking like now, and what do you want it to look like?
Also what is the exact command invocation that generated the sample output?
Software versions and Linux distribution will be most welcome information as well.
_________________ ArchLinux x86_64 - Custom Built Desktop
ArchLinux x86_64 - Compaq CQ50 Laptop
ArchLinux i686 - Acer Aspire One Netbook
ArchLinux i686 - Dell Presario ze2000 (w/ shattered LCD)
PuppyLinux, CloneZilla, PartedMagic, DBAN - rescue thumbdrives
Windows 7 (x86_64 desktop alternate boot)
|
|
Back to top |
|
orphius New Member
Joined: 25 Sep 2025 Posts: 9
|
Posted: Wed Nov 25, 2025 5:11 pm Post subject: |
|
|
the command I am using is as follows:
( sudo clamscan -r -i -v --exclude-dir=^/sys\|^/proc\|^/dev\|^/mnt\|^/media\|^/zarchives\|^/personal/bckups\|^/personal/tarsave --remove=yes --detect-pua=yes / )
The only way I can describe what I want is that between each file scanned being output, a clear command is used or similar.
So that each file is displayed in the same space and line. First file, clear, second file, clear, third file, etc.
I would show you output, but I have no app that does it that way. I just know I have seen it done.
I am using Arch linux and Bash4
If you can't help because of my lack of being able to explain. No big deal and I appreciate the effort.
_________________ ArchLinux x86_64
|
|
Back to top |
|
exiled Jr. Member

Joined: 24 Nov 2025 Posts: 51 Location: ~/
|
Posted: Wed Nov 25, 2025 5:58 pm Post subject: |
|
|
Your output from clamscan is redirected into temp_file.txt
line by line is read from the file on a 2 second interval, replacing the existing line.
Substitute your clamscan command for the simple one I used,
you might also want to change the temp_file.txt path or sleep interval.
Any questions let me know
Code: | #!/bin/env bash
clamscan -r /home > ~/temp_file.txt
while read line
do
echo -e "$line"
sleep 2
clear
done < ~/temp_file.txt
rm ~/temp_file.txt |
_________________ Currently: Frugalware, Fedora
Previously: Gentoo, Startcom, Debian, Sabayon, Mint, openSUSE, Mangaka Chu, #!CrunchBang
|
|
Back to top |
|
exiled Jr. Member

Joined: 24 Nov 2025 Posts: 51 Location: ~/
|
|
Back to top |
|
Lord.DragonFly.of.Dawn Advanced Member

Joined: 18 Jul 2025 Posts: 607 Location: South Portland, Maine, USA, Earth, Sol System
|
Posted: Thu Nov 26, 2025 4:26 am Post subject: |
|
|
orphius wrote: | the command I am using is as follows:
( sudo clamscan -r -i -v --exclude-dir=^/sys\|^/proc\|^/dev\|^/mnt\|^/media\|^/zarchives\|^/personal/bckups\|^/personal/tarsave --remove=yes --detect-pua=yes / )
The only way I can describe what I want is that between each file scanned being output, a clear command is used or similar.
So that each file is displayed in the same space and line. First file, clear, second file, clear, third file, etc.
I would show you output, but I have no app that does it that way. I just know I have seen it done.
I am using Arch linux and Bash4
If you can't help because of my lack of being able to explain. No big deal and I appreciate the effort. |
Thank you for your information. I still need a sample of what is being printed *now*. please provide such a sample output.
_________________ ArchLinux x86_64 - Custom Built Desktop
ArchLinux x86_64 - Compaq CQ50 Laptop
ArchLinux i686 - Acer Aspire One Netbook
ArchLinux i686 - Dell Presario ze2000 (w/ shattered LCD)
PuppyLinux, CloneZilla, PartedMagic, DBAN - rescue thumbdrives
Windows 7 (x86_64 desktop alternate boot)
|
|
Back to top |
|
orphius New Member
Joined: 25 Sep 2025 Posts: 9
|
Posted: Thu Nov 26, 2025 8:22 am Post subject: |
|
|
exiles, neither of yours worked, got no output at all.
Lord.DragonFly.of.Dawn,
here is a sample of the standard output i am getting:
Scanning /personal/myscripts/instal3k
Scanning /personal/myscripts/templates/hw
Scanning /personal/myscripts/templates/toad
Scanning /personal/myscripts/templates/weather-short
Scanning /personal/myscripts/templates/hello
Scanning /personal/myscripts/templates/myswitches
Scanning /personal/myscripts/templates/mntunmnt
Scanning /personal/myscripts/templates/acheck
Scanning /personal/myscripts/templates/weather-long
Scanning /personal/myscripts/templates/motdmake
Scanning /personal/myscripts/templates/rlevel
Scanning /personal/myscripts/templates/bash-colors
Scanning /personal/myscripts/templates/bips.7z
Scanning /personal/myscripts/templates/bash-starter
Scanning /personal/myscripts/templates/alltemps
Scanning /personal/myscripts/templates/bash-tips
I hope this helps
_________________ ArchLinux x86_64
|
|
Back to top |
|
exiled Jr. Member

Joined: 24 Nov 2025 Posts: 51 Location: ~/
|
Posted: Thu Nov 26, 2025 1:05 pm Post subject: |
|
|
Ha! Ha! Ha!
orphius, how familiar are you with scripting?
You are running Arch, so I assume you know how to save, edit and make a script executable.
This is not rocket science, there are barely 6 lines of code there and I assure you those scripts are solid and do work.
Prior to posting, I successfully tested my scripts with 3 different inputs.
I don't have clamscan installed, but if it outputs as you have shown, both scripts will work.
Good luck to you...
and Happy Thanksgiving
Now that I think about it...
How is it your running Arch and need help with such a simple script?
You are probably very familiar w/ the command line, what gives??
_________________ Currently: Frugalware, Fedora
Previously: Gentoo, Startcom, Debian, Sabayon, Mint, openSUSE, Mangaka Chu, #!CrunchBang
|
|
Back to top |
|
orphius New Member
Joined: 25 Sep 2025 Posts: 9
|
Posted: Thu Nov 26, 2025 1:47 pm Post subject: |
|
|
exiled.
I am very familiar with the command line and basic scripting. I have even
written some very basic ones. It just seems for some reason when ever I try
to figure this one out, I get brain freeze. Haven't you ever had that happen?
Or is it just me?
EDIT:
Just tried it again. This is what I came up with:
Code: | #!/bin/bash
clamall=(clamscan -r -i -v --exclude-dir=^/sys\|^/proc\|^/dev\|^/mnt\|^/media\|^/zarchives\|^/personal/bckups\|^/personal/tarsave --remove=yes --detect-pua=yes /)
${clamall} > ~/temp_file.txt
while read line
do
echo -e "$line"
sleep 1
clear
done < ~/temp_file.txt
rm ~/temp_file.txt
|
its alittle slow, any way to speed it up a little?
EDIT:
Now all it will do is scan the active folder.
I think this is more trouble than its worth.
Thank you for the help Everyone!
_________________ ArchLinux x86_64
|
|
Back to top |
|
|