13
votes
Why don't tail or cat display new content of a file to which another process is writing?
Python file writes are buffered, so even though you keep calling Python's write(), the underlying OS write() system call isn't called until the in-memory buffer fills, or the file is closed.
If you ...
10
votes
read in Bash and ZSH
The options for the read command are significantly different between bash and zsh. In this case, the problem is that -n has completely different meanings between the two: in bash, it says how many ...
4
votes
Accepted
Using read to capture multiple variables from a command's output
read -r video audio will capture the first ($IFS separated) word into "video" and the rest of the line into "audio"
Another way to capture 2 lines is with command grouping and a ...
4
votes
Using read to capture multiple variables from a command's output
read reads one line by design. The simplest way to read two lines is to use read twice.
exec 3< <(youtube-dl -g --youtube-skip-dash-manifest 'https://www.youtube.com/watch?v=-gcvAxJJiGo')
IFS= ...
3
votes
How to disable 'Save As' option and prohibiting file saving in Adobe Acrobat?
No, not within the PDF file itself. Your only options are:
Restrict view permissions: require a password or manage the file system/sharing permissions
Restrict edit permissions: make it read-only ...
2
votes
Accepted
Why is this Bash command output different from what is expected when I run the command in Debian?
For some reason, echo behaves differently on different platforms.
So, as this Stack Overflow answer explains, replace echo with printf for consistent output across different platforms.
Knowing that, ...
2
votes
Accepted
Speed up reading a large number of files (random read)
The books folder is actually distributed as a tarball of a large number of files, I have first untarred the tarball, then unzipped each zip file to obtain the books folder. If there is a way to ...
1
vote
Accepted
Reading Maildir files
Using Thunderbird: Install Thunderbird; configure the 'Local Folders' pseudo-account to use Maildir storage; create an empty folder; manually load the Maildir contents (i.e. the cur, new, tmp ...
1
vote
Accepted
Using read -r within in-line shell scripting
I guess the $file variable you pass to sh is interpreted outside the sh context.
You should try to escape the dollar sign : \$file.
You can also add escaped quotes around \" to deal with filename ...
1
vote
Why man read don't contain any argument description in my debian?
ref: https://en.wikipedia.org/wiki/Man_page#Manual_sections
Note the 2 in READ(2) - that tells you're viewing something from section 2 of the man pages.
Depending on which OS you're using, the section ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
read × 15bash × 6
command-line × 4
linux × 3
hard-drive × 2
zsh × 2
windows × 1
debian × 1
email × 1
security × 1
performance × 1
permissions × 1
shell × 1
batch × 1
script × 1
passwords × 1
file-permissions × 1
redhat-enterprise-linux × 1
bash-scripting × 1
rename × 1
shared-folders × 1
postgresql × 1
smart × 1
ms-dos × 1
command-line-arguments × 1