This single command is not working in BKWP64's terminal???

For discussions about programming, and for programming questions and advice


Moderator: Forum moderators

Post Reply
Clarity
Posts: 3892
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1645 times
Been thanked: 528 times

This single command is not working in BKWP64's terminal???

Post by Clarity »

I am booted to BKWP64 v1008 by @radky.

IN a terminal, I am overlooking something.

Scenario:

  1. I am trying to pipe the output into opening the geany command.
    find . -name "*.iso" -mtime -30 | geany -

  2. In bash, I thought the "-" argument tells the command to read the input from standard input (stdin), which is where the piped output is coming from.

  3. But, this is not working because geany opens to an empty file named "-"?

Works fine if I pipe to a file and geany opens the file, but can I do this without the intermediate file?
What understanding am I missing?

Edit: Hummm??? Maybe geany 'must' not be able to accept input way??? Could that be right?

User avatar
bbbhltz
Posts: 28
Joined: Sun Sep 29, 2024 8:04 am
Location: Europe
Has thanked: 9 times
Been thanked: 6 times
Contact:

Re: This single command is not working in BKWP64's terminal???

Post by bbbhltz »

I've always taken the long way and redirected the output to a file and then opened the file.

Looks like this is still an open issue too: https://github.com/geany/geany/issues/780

bbbhltz
longtime desktop Linux user; eternal newbie
blog mastodon

geo_c
Posts: 2883
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 2208 times
Been thanked: 880 times

Re: This single command is not working in BKWP64's terminal???

Post by geo_c »

bbbhltz wrote: Mon Oct 07, 2024 7:59 pm

I've always taken the long way and redirected the output to a file and then opened the file.

Looks like this is still an open issue too: https://github.com/geany/geany/issues/780

could do a long double command:

Code: Select all

find . -name "*.iso" -mtime -30 | names.txt &;  geany names.txt

Don't know if that ampersand is needed or not.

geo_c
Old School Hipster, and Such

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: This single command is not working in BKWP64's terminal???

Post by rcrsn51 »

geo_c wrote: Tue Oct 08, 2024 12:39 am

Code: Select all

find . -name "*.iso" -mtime -30 | names.txt &;  geany names.txt

Don't know if that ampersand is needed or not.

Did you test this yourself first?

geo_c
Posts: 2883
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 2208 times
Been thanked: 880 times

Re: This single command is not working in BKWP64's terminal???

Post by geo_c »

rcrsn51 wrote: Tue Oct 08, 2024 12:58 am
geo_c wrote: Tue Oct 08, 2024 12:39 am

Code: Select all

find . -name "*.iso" -mtime -30 | names.txt &;  geany names.txt

Don't know if that ampersand is needed or not.

Did you test this yourself first?

Yes, good point, so I tested it, and I had it wrong, instead of piping to the text file the correction should look like this:

Code: Select all

find . -name "*.iso" -mtime -30 > names.txt;  geany names.txt

The ampersand should NOT be there, it tanks the command. The above produces this output file and opens it with geany:

names.txt:

Code: Select all

./KLV-Airedale-sr15.iso

Interesting though, I had two .iso files in that directory and it only listed the first one. What does the -30 option mean? Less than 30 days old?

answer, yes that must be it, because I changed it to -120 and it listed both files, the Spectr.iso being dated 08-09 and the Airedale.iso dated 09-26:

Code: Select all

./KLV-Spectr-sr3.iso
./KLV-Airedale-sr15.iso

geo_c
Old School Hipster, and Such

User avatar
MochiMoppel
Posts: 1244
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 22 times
Been thanked: 445 times

Re: This single command is not working in BKWP64's terminal???

Post by MochiMoppel »

Clarity wrote: Mon Oct 07, 2024 7:35 pm

This single command is not working in BKWP64's terminal???

Your command will not work in any terminal

2. In bash, I thought the "-" argument tells the command to read the input from standard input (stdin), which is where the piped output is coming from.

Has nothing to do with bash. What argument a command uses to indicate reading from stdin - if this is supported at all - depends on the command's syntax. Could be "-", could be "-s" (e.g. gtkdialog), could be "-file -" or could be nothing at all.

What understanding am I missing?

You are missing that Geany doesn't support reading from stdin. You could use Leafpad instead. This would work:
find . -name "*.iso" -mtime -30 | leafpad

Clarity
Posts: 3892
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1645 times
Been thanked: 528 times

Re: This single command is not working in BKWP64's terminal???

Post by Clarity »

Hi @MochiMoppel!

Over the years your coding knowledge has been a GREAT help to so many of us! Thanks for the guidance.

Post Reply

Return to “Programming”