473,378 Members | 1,469 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,378 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 1212

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....
1
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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:
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...

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.