Linked Questions
16 questions linked to/from How can I make iconv replace the input file with the converted output?
9
votes
2
answers
7k
views
Can I read and write to the same file in Linux without overwriting it? [duplicate]
Possible Duplicate:
How can I make iconv replace the input file with the converted output?
I frequently connect to amazon ec2 using their public DNS names (ec2-12-34-56-78.compute-1.amazonaws.com) ...
7
votes
2
answers
14k
views
Redirecting tr stdout to a file [duplicate]
Possible Duplicate:
How can I make iconv replace the input file with the converted output?
Can I read and write to the same file in Linux without overwriting it?
$ cat test.txt
This is a test ...
5
votes
4
answers
6k
views
Command line 'buffer' [duplicate]
I wanted to tail the last 100 lines of a file to the same file, but the command
tail -n 100 file > file doesn't work, I assume because the stdout gets written to the file 'live', before everything ...
0
votes
3
answers
1k
views
Way to automatically replace original file with output? [duplicate]
I have a website where I'm formatting sass (.scss) files with the sass-convert command. Its syntax is this:
$> sass-convert original.scss formatted.scss
Since I'm in a git repo, having a separate ...
0
votes
1
answer
722
views
How can I use a file in a command and redirect output to the same file without truncating it? [duplicate]
cat package.yaml > package.yaml
The above will truncate package.yaml, and hence the file will be empty - cat will have empty output.
How can I avoid truncating the file? Is there an alternative to ...
0
votes
1
answer
212
views
Redirecting head output for update hosts file [duplicate]
Possible Duplicate:
How can I make iconv replace the input file with the converted output?
I'm writing a script to change the content of my hosts file but I got stuck on the head output ...
442
votes
3
answers
230k
views
What are the shell's control and redirection operators?
I often see tutorials online that connect various commands with different symbols. For example:
command1 | command2
command1 & command2
command1 || command2
command1 && command2
...
68
votes
11
answers
35k
views
Is there a way to modify a file in-place?
I have a fairly large file (35Gb), and I would like to filter this file in situ (i.e. I don't have enough disk space for another file), specifically I want to grep and ignore some patterns — is there ...
121
votes
4
answers
55k
views
Does sort support sorting a file in-place, like `sed --in-place`?
Is there no option like --in-place for sort?
In order to save results to the input file, sed uses -i (--in-place).
Redirecting the output of sort to the input file
sort < f > f
results in ...
19
votes
5
answers
14k
views
Completely buffer command output before piping to another command?
Is there a way to only execute a command after another is done without a temp file?
I have one longer running command and another command that formats the output and sends it to a HTTP server using ...
10
votes
6
answers
13k
views
Why does the command shuf file > file leave an empty file, but similar commands do not? [duplicate]
I know this is sort of a duplicate of another question (Why this sort command gives me an empty file?) but I wanted to expand on the question in response to the answers given.
The command
shuf ...
15
votes
6
answers
10k
views
IO redirection and the head command
I was trying to quickly edit an .hgignore file from the Cygwin bash shell today, and I added a line that was a mistake. I'm not sure if this was the best way to do it, but I quickly thought of using ...
0
votes
1
answer
14k
views
centos locale utf-8
This is my linux box:
CentOS Linux release 6.0 (Final)
x86_64
Using a text editor (vi, or pico...) I see strange characters for accented letters (è, ì, à, ù)
This is my locale:
LANG=en_US.UTF-8
...
3
votes
1
answer
3k
views
iconv terminated by signal 7
I was running a little bash script on some text files:
find . -name "*.dat" -exec iconv --from-code='UTF-8' --to-code='ASCII//TRANSLIT' {} --output={} \;
My machine is a Ubuntu 14.04 LTS.
After a ...
2
votes
3
answers
1k
views
copy the pattern of awk and paste it next line
I have many txt files in a folder. Each file contains one line in this format;
8852 0.53451 0.55959 0.65494 0.36047
I would like to add, in the next line, a fixed number and the rest 4 columns ...