The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Delete a portion of a line using shell scripting Loy81 Shell Programming and Scripting 3 08-25-2008 02:54 PM
Need help in splitting a line into fields in shell scripting punithavel Shell Programming and Scripting 2 06-25-2008 05:01 PM
How do i iterate thru each line of a file in shell scripting? Ravi Varma Shell Programming and Scripting 2 09-06-2007 12:28 AM
End of Line in Shell Scripting 33junaid Shell Programming and Scripting 2 08-12-2007 12:03 PM
who to deal with whole line in shell scripting KSA Shell Programming and Scripting 2 08-02-2006 09:12 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-19-2008
meet123321 meet123321 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 4
add a line at the end of a file using shell scripting

Hi All ,
I am new to shell scripting.
i have a shell script(which is executed as a super user) , i want to it to do one more job for me. ie mounting a directory over other using lofs .
i have done it manually using
1) using mount command
mount -F lofs /export/home/dju /dju
2) putting an entry into the end of /etc/vstab file
/export/home/dju - /dju lofs - yes -



how can i do this in shell script .

can somebody help me.

Regards
Aki
  #2 (permalink)  
Old 09-19-2008
manosubsulo manosubsulo is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 87
Try this.. it may help you.


Code:
echo "<Text need to add end of File >"  >>  /etc/vstab

  #3 (permalink)  
Old 09-19-2008
meet123321 meet123321 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 4
thanks 4 ur reply !!
can i be sure that line will be appended at the end of file.?
Also how can i perform mount command ...
  #4 (permalink)  
Old 09-19-2008
nua7 nua7 is offline
Registered User
  
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 353
Yes it will be added at the end of the line.

For mount command :


Code:
man mount

  #5 (permalink)  
Old 09-19-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
A command in a script is not different from a command you write at the command line, except you write it in a file instead, and chmod +x the file. You should probably also have an explicit #!/bin/sh at the top of the file.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0