Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Print piped commands as they are executed #36

Open
1 task done
zulc22 opened this issue Mar 7, 2022 · 5 comments
Open
1 task done

[FR] Print piped commands as they are executed #36

zulc22 opened this issue Mar 7, 2022 · 5 comments

Comments

@zulc22
Copy link

zulc22 commented Mar 7, 2022

Checks

  • I have checked existing feature requests for duplicates and found none

Describe the FR

If you create a "script" for pfsshell and attempt to pipe it in, the prompt is the only thing shown on screen and it doesn't really let the user know what's happening or how much of the script has executed.

device /dev/sdc
mount __common
put file.ext
umount
exit

cat script.txt | pfsshell

Describe the solution you'd like

Print piped commands as they are executed

Describe alternatives you've considered

No response

Additional context

No response

@uyjulian
Copy link
Member

uyjulian commented Mar 7, 2022

You can use tee to also print commands to console

@zulc22
Copy link
Author

zulc22 commented Mar 7, 2022

You can use tee to also print commands to console

At least on Windows, that most definitely does not work. type [file] | busybox tee CON | pfsshell just prints out all of the text, ignoring whether pfsshell tried to read the line yet or not.

@uyjulian
Copy link
Member

uyjulian commented Mar 7, 2022

Due to how buffering works it will read as much as possible from the input

@AKuHAK
Copy link
Member

AKuHAK commented Mar 9, 2022

@zulc22 it looks like that even tee is not necessary:
https://github.com/GDX-X/PFS-BatchKit-Manager/blob/main/PFS-BatchKit-Manager/!PFS-BatchKit-Manager.bat#L1182-L1185
maybe @GDX-X can provide more piping examples

echo device !@hdl_path! > "%~dp0TMP\pfs-prt.txt"
echo ls -l >> "%~dp0TMP\pfs-prt.txt"
echo exit >> "%~dp0TMP\pfs-prt.txt"
type "%~dp0TMP\pfs-prt.txt" | "%~dp0BAT\pfsshell" 2>&1 | "%~dp0BAT\busybox" tee > "%~dp0TMP\pfs-prt.log"

@GDX-X
Copy link

GDX-X commented Mar 9, 2022

@zulc22 I couldn't find how to print the piped commands as they are executed in the console.

if you want to understand how pfsshell works, use it do your commands one by one directly then redo the shema in echo that you will put in a txt.

like in the example that AKuHAK showed you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants