Script that also create a script, how can i save it?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script that also create a script, how can i save it?
# 8  
Old 10-25-2010
thanks all. thanks mike. it now works Smilie
# 9  
Old 10-25-2010
Instead of using multiple echo's, try using here document.

Code:
cat > resultofsample.sh <<EOF
#!/bin/bash
# codes
EOF

This User Gave Thanks to agn For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to create runtime variables based on the number of parameters passed in the script

Hi All, I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them abc.sh ---------- export Numbr_Parms=$# export a=1 while do export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies

2. Shell Programming and Scripting

Expect script to save configuration from a router

Hy guys, My name is Alex, i am new here and I hope to find some answers. I am trying to run a expect script to telnet to a mikrotik router, run a command (export), and save the output of that commant to a file (outputfile.txt). The problem is that only part of the output is saved to... (2 Replies)
Discussion started by: axexandru
2 Replies

3. Shell Programming and Scripting

Script to scrape page for and save data

Hi All I would like to get cars DB from this web site link removed , and I am trying to right script to go and parse the web page and save the data for each cars into a file, type of cars, mark, model, but when I look to the source page I found out that the first car type is preselected and the... (3 Replies)
Discussion started by: molwiko
3 Replies

4. Shell Programming and Scripting

Save output to file - inside a script ?

I'm using the following script to check cisco router health and I'd like to save output to a file, vty_runcmd.sh > /check/check-cisco-health script works and output is saved to a file. However using it in crontab file is created but output is not printed inside it. In crontab, */5 * * * *... (4 Replies)
Discussion started by: marmellata
4 Replies

5. Programming

CGI Perl script to execute bash script- unable to create folder

Hi I have a bash script which takes parameters sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

6. Shell Programming and Scripting

open file and save as script

hi guys i have a problem with my file did not work as usual. The problem is i need to open the file and save as using same name and after that the file is work properly. Is it any shell script can do open the file and save as using same name..because i have thousand of file with the same problem (3 Replies)
Discussion started by: zulabc
3 Replies

7. UNIX for Dummies Questions & Answers

How to save a shell script in Uwin

Hi All, Actually im new to Unix and trying to learn shell scripting in uwin(freeware) on windows xp machine. I tried writing the shell script with vi mode, but my problem is I am unable to save this script file even after specifying :wq option ie I am unable to save the file and quit from vi mode... (1 Reply)
Discussion started by: vikkram
1 Replies

8. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

9. UNIX Desktop Questions & Answers

script to save file

Hello evry1, Trying to come up with a script that picks content from another file, and saved the new file with the original file name but adding the time when the script is run to the new file name. after which it compresses this new file. Thanks in advance (1 Reply)
Discussion started by: Targ
1 Replies

10. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies
Login or Register to Ask a Question