Tag Info

Hot answers tagged

3

This is called typeahead, and it's not shell specific. What you type ends up being buffered in the terminal, and the next time a program running in the terminal is ready for input it reads what is waiting in the buffer. In your example that program is the shell, so it executes the command you typed as if you'd waited for A to finish before typing it. Some ...


3

In your script file named hexto64, simply write : #!/bin/bash printf "%s" "$1" | xxd -r -p | base64 And then you can use it as such : hexto64 49276d2 Just so you know, $1 means the first parameter you gave after the program name : 49276d2 in our case.


2

It sounds like what you are describing is actually program A running in the background. A process can still print to the terminal even if it is running in the background. A bash example: #----background_program----# #!/bin/bash for ((i=0;i<=10;i++)); do echo "$i" sleep 5 done exit 0 You can run this in the background, see its output popping ...


1

i=0 { paste res.? res.?? res.??? while paste ./res."$((i+=1))"[0-9][0-9][0-9] do :; done; } >outfile I don't think this is as complicated as all that - you've already done the hard work by ordering the filenames. Just don't open all of them at the same time, is all. Another way: pst() if shift "$1" then paste "$@" fi set ...


1

Given the amount of files, line sizes, etc. involved, I think it will surpasses the default sizes of the tools (awk, sed, paste, *, etc) I would create a small program for this, it would not have 10,000 files open, nor a line of hundred of thousands in length (10,000 files of 10 (max size of line in the example)). It only requires an ~10,000 array of ...



Only top voted, non community-wiki answers of a minimum length are eligible