command line - Bash write to file without echo? -


as exercise, method exist redirect string file without echo? using

echo "hello world" > test.txt 

i know cat , printf. thinking like

> test.txt <<<"hello world" 

of course doesnt work, maybe similar command?

you can "cat" , here-document.

cat <<eof > test.txt text eof 

one reason doing avoid possibility of password being visible in output of ps. however, in bash , modern shells, "echo" built-in command , won't show in ps output, using safe (ignoring issues storing passwords in files, of course):

echo "$password" > test.txt 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -