Jump to content


Bash / SH script help

  • Please log in to reply
2 replies to this topic

#1 mikem1034

  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 12 February 2013 - 08:17 PM


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.

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?

#2 trq

  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 13 February 2013 - 10:13 AM

How about you try and write it and come back when you have a specific issue?

The example you posted really isn't that far off.

#3 jazzman1

  • Moderators
  • Advanced Member
  • 2,715 posts
  • LocationMississauga, Canada

Posted 14 February 2013 - 02:21 PM

How did you solve the issue?

I know how to do this, but the principle of that forum is to share solutions to each other.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users