473,396 Members | 1,929 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,396 software developers and data experts.

Variable position in echo is changing the result

I used grep to fetch result from two files and store the result in two variable respectively. while I echo the output of two variable at that time if I change the position of variable then the result is changing . The scenario is explained below with the example
Expand|Select|Wrap|Line Numbers
  1. i=123
  2. res1=`grep S$i $NamesFile` 
  3. res2=`grep S$i $FeeInformation|awk '{$1="" ; print $0}'` 
  4. echo "$res1 $res2" ## this prints the value from both variable separated by space 
  5. echo "$res2 $res1" ## in this the variable two override the output of variable one
  6.  

the issue is happening only on my terminal I tested it in other machine it is working fine , even In my terminal it was working till yesterday , don't know what change has happened which impacted this

NameFile contains the information like Student_id Name_of_student Mobile_No Location Email_id

FeeInformation file contains values Student_id Class Fee Admission_type(DOnation/Free)

Please suggest what could be the possible reason for this . Thanks in advance
Feb 19 '14 #1
0 1216

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

Similar topics

10
by: Jack | last post by:
How would I add a variable that I will assign to a list of $_POST variables that I extract from a form? My form passes a value for $q. That works fine. What I want to do is run an if/else on it...
1
by: Regnab | last post by:
I've got a value in an access table which I would like to use in my vba code. I figure the best way to work with it is to assign its value to a variable in my code. I imagine this would be done...
10
by: Altman | last post by:
I have only done a little programming in C++ so I am still learning but I am having a problem with a variable that is changing on me. I have tried this 2 ways with the same result. I have a...
3
by: Aziz | last post by:
1. I have a shopping basket DataGrid with a list of products. What I want to do is when the user clicks on a row, a button will become visible/be created that allows user to edit the quantity. The...
4
by: webandwe | last post by:
Hi, I have a database with a row called "time". I need to somehow add up all the time rows and then echo out the total. How do I do it? Example MySQL -----------
3
by: DavidPr | last post by:
I've tried to incorporate an IF Statement into the below so that if the query returned nothing - a message saying "There are no jobs currently listed" would be displayed, but for some reason it...
3
by: rando1000 | last post by:
What syntax can I use to vary the location Mid and Left start at based on a text string? Fox example, if I have a field called "Fieldname", with data "My Text is in this field", and I want to remove...
3
by: igurov | last post by:
Hi all, I have the following simple cmd. script: @ECHO OFF copy "C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\date_string\date_string\bin\Release\date_string.exe" c:\temp set...
0
by: George Bush | last post by:
port2_result=os.popen('ipmitool raw 0x3a 0x11 0x2a 0x6f 0x00 8').read() this is the expression i've written in a script after calling a procedure to establish SSH connection to a remote machine. the...
7
by: Arsale | last post by:
I am trying to pass a javascript variable to php on javascript generated page, but on the new page I got only "Array". Where did I go wrong? On first page, i've got image map with areas....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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:
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.