473,320 Members | 1,870 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,320 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 3212
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.