Jump to content

Bash / SH script help


mikem1034

Recommended Posts

Hi!

 

I need to create a script that will create a file and dump formatted text into it. I need to run the script with an argument which will be the filename.

 

#!/bin/sh
echo "Hello world" > ../directory/$arg1.txt

 

I need the text added to the file to be like:

class Arg1 {
public function x() {
....
}
}

 

Can anybody help me create a script to do this?

Link to comment
https://forums.phpfreaks.com/topic/274410-bash-sh-script-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.