473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

I have a problem in echo statement ?

Hi Bytes..


I have command like this..

echo "km=cat /proc/meminfo | grep MemFree | awk '{ print $2 }' "

i want to redirect this output to a file or output prompt i got printed

km=cat /proc/meminfo | grep MemFree | awk '{ print }'

actually i want to print the full command in file .

like this below ,

echo "km=cat /proc/meminfo | grep MemFree | awk '{ print $2 }' "

what i have to do tel me some suggestion .
Feb 13 '09 #1
3 3216
micmast
144 100+
echo "km=cat /proc/meminfo | grep MemFree | awk '{ print \$2 }' "
Feb 13 '09 #2
Thanks for reply.

i need one more thing about displaying the output like below when i redirect the output in a file.

echo "km= `cat /proc/meminfo | grep MemFree | awk '{ print \$2 }'` "

this full command must be store in a file so what i want to add in front of that echo so as to get the output below when i run that file.

echo "km= `cat /proc/meminfo | grep MemFree | awk '{ print \$2 }'` "

in a file

Please do help or give me an suggestion for this problem.
Feb 13 '09 #3
micmast
144 100+
I think you want to store the command in a file right?
this can be done like this:

echo "km= `cat /proc/meminfo | grep MemFree | awk '{ print \$2 }'` " > run.sh

> to append
>> to write a new file
Feb 13 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michael McGarrigle | last post by:
I am relatively new to SQL Server. I have a command file with the following contents : osql -E -i%1.sql -d%2 -oq:\%1.log The sql script file has a number of insert/update statements. The log...
21
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
2
by: peridian | last post by:
I've gotten a really weird result crop up on my site, and I can't find any information on the web that it has been seen elsewhere. Given how weird this is, I guess it's probably a symptom of either...
3
by: Doug (dtism) | last post by:
Hello **newbie alert** <-- that's me btw, but you might have guessed that by my topic title. I have an html page that submits a name and email address by a form to a page called preview.php ...
3
by: den5385 | last post by:
<?php echo "bbb"; include("common/funcs.php"); echo "a"; ?> When accessing the above test code from a browser it prings 'bbba.' When accessing the page from a MFC app, it just prints 'bbb.'...
2
by: L. Berger | last post by:
Hi, I am working on an HTML template which has a lot of html tags, with PHP data shown in the middle of these tags -- you know, the usual. Currently, I have HTML as is, and many many "echo...
5
by: AnDyG | last post by:
Hi everyone, i have a php script that echoes the following code from an if statement, what i need to do is make part of this only show if ($cat=="fireplaces.php"). Does anybody have any...
2
by: runway27 | last post by:
i have a question about using header("Location: filename.html"); in php with my present code i have a few echo statements followed by header("Location: filename.html"); because i have echo ...
32
by: Request-1 | last post by:
hi folks, html coder here, new and terrified * of php!! aaaaaa! i'm trying to bury a JS script to rotate a photo, in a page i converted from html to php. the conversion went well, it was to...
5
by: tasteofchaos | last post by:
Hey guys. Unfortunately I can't break out of an echo to run the if statement I want to run because it's pulling data for a certain row. I'd like text truncated to a certain amount of characters...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.