Re: count in vi mode alters prompt

2025-05-15 Thread Mohamed Akram
I’ve opened an issue in the readline repo for this with a patch if there’s interest. https://savannah.gnu.org/support/?111068 I had been using this patch for some months in my own build of bash and it seems to be working well. More recently I’ve just used the default zsh on a new machine since

Re: count in vi mode alters prompt

2024-05-20 Thread Chet Ramey
On 5/20/24 9:34 AM, Mohamed Akram wrote: Is there a way to disable this feature, at least in vi mode? No. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/

Re: count in vi mode alters prompt

2024-05-20 Thread Mohamed Akram
Is there a way to disable this feature, at least in vi mode? > On May 20, 2024, at 5:27 PM, Chet Ramey wrote: > > On 5/18/24 5:28 PM, mohd.ak...@outlook.com wrote: > >> Bash Version: 5.2 >> Patch Level: 26 >> Release Status: release >> Description: >> When using vi mode in bash, whenever a

Re: count in vi mode alters prompt

2024-05-20 Thread Chet Ramey
On 5/18/24 5:28 PM, mohd.ak...@outlook.com wrote: Bash Version: 5.2 Patch Level: 26 Release Status: release Description: When using vi mode in bash, whenever a count is used before a command, bash replaces the prompt with (arg: n) where n is the count entered. This cause

Re: count

2015-12-21 Thread Krem
Here is another problem with the following script find . \( -iname '*.txt' -o -iname '*.csv' \) -exec bash -c ' for f; do IFS=/ read -ra part <<< "$f" printf "%-10.10s %-10.10s %-20.20s %5d\n" \ "${part[1]}" "${part[2]}" "${part[3]}" "$(wc -l < "$f")" done ' _ {} + _: -c

Re: count

2015-12-21 Thread John McKown
I've "squirreled" that one away on GitHub, in a gist. Thanks. On Mon, Dec 21, 2015 at 11:00 AM, Greg Wooledge wrote: > On Mon, Dec 21, 2015 at 08:53:55AM -0700, Krem wrote: > > I tried this one, but failed if the folder has more than one file name > (eg > > *.csv) in that folder. > > Seriously,

Re: count

2015-12-21 Thread Greg Wooledge
On Mon, Dec 21, 2015 at 08:53:55AM -0700, Krem wrote: > I tried this one, but failed if the folder has more than one file name (eg > *.csv) in that folder. Seriously, use this one: find . \( -iname '*.txt' -o -iname '*.csv' \) -exec bash -c ' for f; do IFS=/ read -ra part <<< "$f" print

Re: count

2015-12-21 Thread Krem
Hi all, Thank you very much for providing me more information, I am getting more confused. but learning more. I tried this one, but failed if the folder has more than one file name (eg *.csv) in that folder. find . -maxdepth 2 -mindepth 2 -type f -name '*.csv' -o -name '*.txt' |\ egrep '^\./[0

Re: count

2015-12-21 Thread John McKown
Thanks for the training. I appreciate people pointing out my errors, that's how I learn too. I'll blame GMAIL for the mish-mash. I don't have as good a control of it as I would like (sorry). I'm always forgetting about people who put LFs in a file name. That is just so weird, to me. I should rememb

Re: count

2015-12-21 Thread Greg Wooledge
On Mon, Dec 21, 2015 at 08:21:04AM -0600, John McKown wrote: > find . -maxdepth 2 -mindepth 2 -type f -name '*.csv' -o -name '*.txt' |\ > egrep '^\./[0-9]' |\ > xargs awk 'ENDFILE {print FILENAME "\t" FNR;}' |\ > sed -r 's|^./||;s|/|\t|' |\ > xargs -L 1 echo -e "${PWD##*/}\t"??? > ???This is "mo

Re: count

2015-12-21 Thread Greg Wooledge
On Mon, Dec 21, 2015 at 07:58:02AM -0600, John McKown wrote: > OOPS, slight correction: > > find . -maxdepth 2 -mindepth 2 -type f -name '*.csv' -o -name '*.txt' |\ > egrep '^\./[0-9]' |\ > while read i;do echo -e "${PWD > ???##???*/ > } $(dirname ${i > ??? > } > ??? | cut -b 3-??? > ) $(basenam

Re: count

2015-12-21 Thread John McKown
On Fri, Dec 18, 2015 at 7:05 PM, Krem wrote: > Hi all, > > I have one folder and this folder contains several folders. Each sub > folders > contains 5 or 6 files. So i want count the number of rows within each > file and produce an output. > > Assume the main folder called A and it has th

Re: count

2015-12-21 Thread John McKown
OOPS, slight correction: find . -maxdepth 2 -mindepth 2 -type f -name '*.csv' -o -name '*.txt' |\ egrep '^\./[0-9]' |\ while read i;do echo -e "${PWD ​##​*/ } $(dirname ${i ​ } ​ | cut -b 3-​ ) $(basename ${i}) $(wc -l ${i})" ;done | cut -d " " -f 1,2,4,3 I needed to put the arguments to "find"

Re: count

2015-12-21 Thread John McKown
Sorry about delay, for some reason Google put your emails in SPAM. Also, I don't really read much email on Sunday. I was "busy" building up my planets in GOFA after church. And watching some TV. Pretty much didn't think about email at all, because I do all that "other stuff" on my tablet, not my PC

Re: count

2015-12-20 Thread Krem
John, After trail and error the following works for me but still has to be refined. find . -type f | while read i; do echo -e "$(dirname ${i}}} | cut -b 3-) $(basename ${i}) $(wc -l ${i})" ; done | cut -d " " -f 1,2,3 1. All the folders that I am interested in are all starts with number 2.

Re: count

2015-12-19 Thread John McKown
On Fri, Dec 18, 2015 at 7:05 PM, Krem wrote: > Hi all, > > I have one folder and this folder contains several folders. Each sub > folders > contains 5 or 6 files. So i want count the number of rows within each > file and produce an output. > > Assume the main folder called A and it has th