The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Not getting the out value parameter of a DB call in the ksh file Sam123 Shell Programming and Scripting 2 02-03-2009 07:01 AM
Reading a Parameter File Raamc Shell Programming and Scripting 1 10-21-2008 12:56 PM
extracting parameter from file bp_vardhaman Shell Programming and Scripting 9 09-04-2008 10:24 PM
reading the parameter from another file dsravan Shell Programming and Scripting 15 12-20-2007 05:59 PM
how do I make dynamic parameter names? Or get the value of a parameter evaluated twi Awanka Shell Programming and Scripting 2 04-19-2007 09:37 PM

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 05-10-2009
justbow justbow is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 39
Question how to print $ parameter to file ??

Hi ,

Actually i want to write "$1" to a file
But i don't know why if im using echo or printf also can't

Quote:
[~]$ echo "$1" > file
[~]$
[~]$ cat file

[~]$ printf "$1" > file
[~]$
[~]$ cat file
[~]$
Somebody can help me ??
  #2 (permalink)  
Old 05-10-2009
anchal_khare anchal_khare is offline
Registered User
  
 

Join Date: Jun 2007
Location: Mumbai,India
Posts: 325
use single quotes

Quote:
echo '$1'
  #3 (permalink)  
Old 05-10-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514
Code:
echo '$1'
or
Code:
echo "\$1"
  #4 (permalink)  
Old 05-10-2009
justbow justbow is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 39
oke thanks

Quote:
[~]$ echo "cat name | awk '{print "\$1""\$2""\$4"" "100*"\$4"/"\$3"}'" > file
[~]$
[~]$ cat file
cat name | awk '{print $1$2$4 100*$4/$3}'
[~]$
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 10:01 AM.


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