Modifying a shell script without using an editor


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Modifying a shell script without using an editor
# 1  
Old 04-22-2011
Question Modifying a shell script without using an editor

Hi all,


I really wan't to know that how to edit a shell script with out using an editor..
Is there any command?
# 2  
Old 04-22-2011
That's a really vague question. what do you want to do?

You can create a script without an editor simply enough:

Code:
cat >script.sh <<"EOF"
var="hello world"
echo "$var"
EOF
chmod +x ./script.sh
./script.sh

This User Gave Thanks to Corona688 For This Post:
# 3  
Old 04-22-2011
hi corona688,

thank you for replying but i want to know how to modify a already created shell script without using an editor.. u have any clue??
# 4  
Old 04-22-2011
Quote:
Originally Posted by buddhi
thank you for replying but i want to know how to modify a already created shell script without using an editor.. u have any clue??
Thank you for replying but repeating the same question again isn't much help when I've already asked you for more detail. To wit:
Quote:
That's a really vague question. what do you want to do?
That you can't give me any more detail than that makes me suspect you're not actually trying to do anything, and this is just a homework question...
# 5  
Old 04-22-2011
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modifying the shell script to select pattern

Hello, I have script which work 70% of the desired task , the output from script.sh is following , however the desired output I require is following . Any piece of suggestion would be great.. thanks in advance, emily #!/bin/bash ... (8 Replies)
Discussion started by: emily
8 Replies

2. Shell Programming and Scripting

Modifying/Adding in the DNS server entry using shell script

Dear Experts. I need to add/modify the entries in the DNS server and this has to be achieved using shell script and below is the requirement, could you please let me know if a shell script can be written for this task? 1. Log in to primary DNS server 2. Check /etc/named.conf if zone is... (4 Replies)
Discussion started by: VKIRUPHAKARAN
4 Replies

3. Shell Programming and Scripting

Modifying contents of the file in shell script

Hello all, I have a Kconfig file that looks like something below ... ================================ menu "Application type" config GUI_TYPE_STANDARD bool "Standard Application" source "cfg/config/std.in" source... (12 Replies)
Discussion started by: anand.shah
12 Replies

4. Shell Programming and Scripting

Execution problem with shell script for modifying a user

#/bin/sh echo "enter the user name" read $username echo "Enter new home directory" read $newhd usermod -d $newhd $username ;; error while executing : enter the user name Rev Enter new home directory: /home/58745 usermod: option requires an argument -- 'd' Try `usermod --help' or... (2 Replies)
Discussion started by: Revanth547
2 Replies

5. Shell Programming and Scripting

Need to overwrite shell script using vi editor

I have an existing shell script that I am trying to modify. I have about 10 lines of info I want to overwrite using text someone emailed to me. I guess what I am trying to do basically is like a copy/paste, but it's not working for me. I am using Cygwin and vi editor. I open the script and... (4 Replies)
Discussion started by: kimberlyg2007
4 Replies

6. Shell Programming and Scripting

Need some help modifying script

I have a script that currently runs fine and I need to add or || (or) condition to the if statement and I'm not sure the exact syntax as it relates to the use of brackets. my current script starts like this: errLog="/usr/local/website-logs/error.log" apacheRestart="service httpd restart"... (3 Replies)
Discussion started by: jjj0923
3 Replies

7. Shell Programming and Scripting

Using Ex editor commands in a shell script - Help!

Hi all, I am trying to use the Ex editor and its commands in a script - more specifically within an if statement within a while loop. Here are the basics of the loop: cat $file1 | while read line do grep $line $file2 if ] then echo $line > $file2 elseex $file2 /ESI185... (4 Replies)
Discussion started by: luke222010
4 Replies

8. Shell Programming and Scripting

Modifying a csv file from Shell Script

Hi all, I have some script that creates a temp csv file. What I need to do is do some search and replace and modify the file from my shell script. I know the commands to open the file and then apply the reg ex but wasnt sure how I could do this from a script and modify the file? Any help... (2 Replies)
Discussion started by: not4google
2 Replies

9. Shell Programming and Scripting

modifying my shell

Hello, I have installed a new program called chimera under the directory /usr/local/bin/chimera. the executable is under the directory /usr/local/bin/chimera/bin/chimera.e If i put myself under the latest directiry and I type ./chimera, the program works. I would like to avoid this and I... (1 Reply)
Discussion started by: nico-hellas
1 Replies

10. UNIX for Dummies Questions & Answers

Modifying from borne shell to C shell

Just want to know a few conversion tricks. in Borne Shell, I have the line: if test -s testmap then ... fi ## testmap is a filename and I wanna test whether it exists ## then do whatever How can I convert that to C Shell? I've tried: if (test -s testmap) then ... endif but it... (3 Replies)
Discussion started by: zenkisoft
3 Replies
Login or Register to Ask a Question