473,657 Members | 2,612 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does code give bash: syntax error on Linux but runs on Windows?

3 New Member
the given code does not run in linux mint isodara.
on typing
cc pg206[G](c).c

in terminal it gives

bash: syntax error near unexpected token `('

wat to do ........
the above code runs in windows turbo c 3.0

the code is as follows
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2.  
  3. void fun(int *,int *);
  4.  
  5. void main()
  6.  
  7. {
  8.  
  9.     int i=5,j=2;
  10.  
  11.     fun(&i,&j);
  12.  
  13.     printf("\n%d %d",i,j);
  14.  
  15. }
  16.  
  17. void fun(int *i,int *j)
  18.  
  19. {
  20.  
  21.     *i=*i**i;
  22.  
  23.     *j=*j**j;
  24.  
  25.  
  26.  
  27. }
Dec 4 '10 #1
1 2230
donbock
2,426 Recognized Expert Top Contributor
You say this code does not run; but the bash error you report is more indicative of a failure during the build process. Is the name of your source file truly pg206[G](c).c ? If so, could you rename the file to get rid of the square brackets and parentheses? I suspect the bash shell believes those characters are commands for it.
Dec 4 '10 #2

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

Similar topics

2
2317
by: jacques | last post by:
hello everybody i have a computer with redhat linux. on this computer i have some python scripts i want to run. i don't want to run them with linux but with windows. so i have a second computer (win) with python installed. how can i lauch the script on the linux? python myscript.py 192.168.1.1 ? thank you for any help.
4
2697
by: John Owens | last post by:
Hi, I'm looking for a plugin for Visual Studio .NET or another IDE etc that would allow me to develop on Windows but have the compiler and debugger and code run on Linux. e.g. Code using Windows Build ( Behind the scenes: FTP updated files over to Linux and then compile
3
1782
by: WantedToBeDBA | last post by:
Hi friend, I want to do "DB2 UDB V8.1 for Linux, UNIX and Windows Advanced Database Administration(704)" certification. Can i write this exam directly or will have to write preceders such as 701 and so on? How much will it cost for me? Thanks, Thiru WantedToBeDBA.
6
2916
by: Brian Miller | last post by:
I've been constructing an ASP.Net application using the 1.1 framework, and have been using Web Matrix for development purposes. Now that my application is near completion, I wanted to see if I can set up my pages for access directly via localhost (not using the WebMatrix server). My login page loads, and any validation controls on the page work fine, so I know it's recognizing the ASP.Net code there, however, when I try to log on, the...
6
1394
by: leonat | last post by:
I have an asp.net webform. When I view the page in the web browser, the html is returned but not any asp code, i.e., " <% ... %> ". This same code works in the "old" asp page BUT NOT in asp.net. See code below: _________________________________________________________________-
2
1194
by: sheelpatel | last post by:
I am currently using php to output the javascript and was just wondering if my syntax was correct as the code does not seem to work <form action="" method="post" name="myform"> <input name="test" type="text" /> <input name="test2" type="text" onclick="document.myform.test2.value = document.myform.test.value" /> <input name="test3" type="text" /> <input name="test4" type="text" onclick="if (document.myform.test4.value ==...
3
1562
bajajv
by: bajajv | last post by:
Hi, I have linux and windows xp on my machine. I have a 1 GB file on linux. And I want to access it from windows. I tried by mapping but I am able to get only read only access. But I need to copy it. Can you suggest any method for that. Its urgent. Thanks.
7
1722
by: pltmcs | last post by:
I have a form that keeps track of keys given to employees. We decided to add a feature to keep a digital signature for the keys so I created a second table to hold the signature and enough information to tie the signature to the key(s) issued. When the information is added to the form, the user clicks on a command button to save and exit the form; Private Sub Command71_Click() On Error GoTo Command71_Error If Not...
3
1644
by: Levi Campbell | last post by:
Hi, I'm trying to write a program for a friend of mine who uses windows but I use GNU/Linux. I know you can use mingw and link to the python dll, but is there a way to create a win32 service under Linux?
19
1820
by: fx5900 | last post by:
Hi, i am trying to convert an .osm (openstreetmap) file into gml format and finally to shapefile given this wiki info http://wiki.openstreetmap.org/index.php/GML. I'm using windows and when i entered the following commands osm2gml.py < map_01_data.osm > map_01_data.gml on my dos prompt i get a number of errors, some of which are bellow: Traceback <most recent call last>:
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.