python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How can I read a file in cat << EOF >
I would like to print a file in cat << EOF>. e.g.
$cat file
ad3
c43
34e
se3
we3
My script is:
$cat run.sh
cat << EOF > test.sh
#!/bin/bash
some commands
cat file #I would like to pr...
Kay
Votes: 0
Answers: 3
bash command cat doesn't work inside an if statement
I can create a file with content using a bash script with the cat command like so:
#!/bin/sh
cat >myFyle.txt <<EOL
Some text inside the file
EOL
This works as intended. But when I try to u...
LukasFun
Votes: 0
Answers: 1
Writing to a file during a script
I need to create and write a file in the middle of a script. Is there a way to do this? Usually, to create and write to a file, I would use cat >file name, then write what I needed and ctrl+d to sa...
Girls_Game_As_Well
Votes: 0
Answers: 2
Merge numbered files with variable names
I have a number of numbered files, e.g.:
alpha_01.txt alpha_02.txt beta_01.txt beta_02.txt
I want to execute a single line bash that will output correctly merged files based on their variable name (e....
Simon Ante
Votes: 0
Answers: 1