5
votes
2answers
800 views

How to append multiple lines to a file without last newline?

I have a very long string that is split in chunks. I want to append them to a file without putting the newline character using bash. Example: First append cat >> abc.sh << EOL echo "bla ...
2
votes
2answers
106 views

Diverting a file write to process

I have an OSX GUI application which I can't change - it writes new CVS lines to a log file when it completes a job. I'd like to work with these new lines, but they are constantly being added. Is ...
4
votes
1answer
283 views

command like wc but with tee behaviour

I want to backup a database using psql and COPY command. here is my script: psql "user=${USERNAME} host=${HOSTNAME} dbname=${DBNAME} password=${PASSWORD}" -c \ "COPY (SELECT * FROM tbl) ORDER BY id ...
4
votes
3answers
510 views

Why do I keep destroying my text files?

I have destroyed a bunch of non-essential files and I don't know why. I have been executing commands like: tr -sc 'A-Za-z' '\n' > somefile.txt | less there is no output (blank page with flashing ...
22
votes
2answers
10k views

How can I make iconv replace the input file with the converted output?

I have a bash script which enumerates through every *.php file in a directory and applies iconv to it. This gets output in STDOUT. Since adding the -o parameter ( in my experience ) actually writes ...