Skip to main content
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 ...
spikey_richie's user avatar
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 ...
Gordon Davisson's user avatar
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 ...
glenn jackman's user avatar
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= ...
Kamil Maciorowski's user avatar
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 ...
Cpt.Whale's user avatar
  • 11.7k
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, ...
Giacomo1968's user avatar
  • 59.4k
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 ...
RedGrittyBrick's user avatar
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 ...
grawity's user avatar
  • 518k
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 ...
Saïmonn's user avatar
  • 426
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 ...
Hannu's user avatar
  • 11k

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