![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| how to attach a variable from the 2nd file to the 1st file | lo tan | Shell Programming and Scripting | 5 | 06-03-2008 02:58 AM |
| Using a variable inside a file to cat another. | MaestroRage | UNIX for Dummies Questions & Answers | 3 | 02-06-2008 02:17 PM |
| print variable in file using awk | kamel.seg | Shell Programming and Scripting | 3 | 01-03-2008 06:43 AM |
| Put one ligne from a file a variable | kykyboss | AIX | 1 | 11-13-2006 08:06 PM |
| How to get variable input from a file | maheshsri | Shell Programming and Scripting | 1 | 10-29-2005 07:26 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hello,
I have a variable and I want to add this variable in a file (not to erase the file, only add, I guess >>). Code:
#config server="<server>Hostname</server>" myfile=myfile.xml net=true if [net] then echo $server >> $myfile fi ![]() |
|
||||
|
Quote:
Few points here: - It should be $net to be tested - It should be used like this: Code:
if $net
then
echo $server>> $myfile
fi
|
|
||||
|
Quote:
give a space before and after net in the if statement like this if [ $net ]; then Thanks Last edited by namishtiwari; 07-02-2008 at 05:00 AM.. Reason: space before and after |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|