New to Linux, have some simple question


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting New to Linux, have some simple question
Prev   Next
# 1  
Old 12-03-2012
New to Linux, have some simple question

Hi All,
Here is the problem: I have done a c++ code in Visual Studio 2010, it's a simple project that only have one main function which takes 2 parameters: an integer and a file that stores data. Now, I am asked to write a shell script in linux to execute my main function. I asked my professor about how to do this, he replies:
"Let's say you've created an executable called ‘test' that takes two arguments ‘file' and ‘id'. Then your script would be:
#!/bin/bash
test $1 $2"

my questions are:
1. is "test" the name of my cpp file or the name of my function?
2. if I have to pass a file as an argument, where should I place my data file?

overall, I just need some basic idea of how to execute my cpp file using shell script, please provide more detail if possible.

Thanks you all in advance. Greatly appreciated!

Best,
Eason Zhang
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Simple sed command not working; could be a Mac/Linux vs. PC/Linux issue

Hello, I am on a Mac and trying to clean up some monthly files with a very simple SED: sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt (from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file) then output to output.txt Even when I try... (2 Replies)
Discussion started by: verbatim
2 Replies

2. Linux

A simple question,linux monitoring tool like Cockpit

This is a screenshot from "cockpit", a nice app of Fedora server,I can see from it disk,network,ram usage for host. https://images2.imgbox.com/e5/7c/oJJqPcQe_o.png The good thing is start preconfigured for host. My question is..someone know a app like this which can monitor a entire... (0 Replies)
Discussion started by: Linusolaradm1
0 Replies

3. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies

4. IP Networking

simple linux networking question

I have 2 linux hosts running oracle RAC DB with multiple ethernet interfaces . Host 1 netstat -tln |grep 6000 Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 :::6000 :::* ... (1 Reply)
Discussion started by: gubbu
1 Replies

5. Programming

Simple C question... Hopefully it's simple

Hello. I'm a complete newbie to C programming. I have a C program that wasn't written by me where I need to write some wrappers around it to automate and make it easier for a client to use. The problem is that the program accepts standard input to control the program... I'm hoping to find a simple... (6 Replies)
Discussion started by: Xeed
6 Replies

6. UNIX for Dummies Questions & Answers

Very simple question

I'm new to unix commands and am wondering how you could create a page with html tags in it. echo "<b>Test</b>" > test.html doesn't work because of the tags. How would I do this. (4 Replies)
Discussion started by: roger19
4 Replies

7. UNIX for Dummies Questions & Answers

Ok simple question for simple knowledge...

Ok what is BSD exactly? I know its a type of open source but what is it exactly? (1 Reply)
Discussion started by: Corrail
1 Replies

8. UNIX for Dummies Questions & Answers

Hopefully simple question

When i type cd etc/shadow it says that file or directory doesnt exist? Is there a way to show this or am i typing something wrong? :confused: (6 Replies)
Discussion started by: Corrail
6 Replies

9. UNIX for Dummies Questions & Answers

Simple Question

Hi All, I am new to UNIX Shell Scripting. I want to know what is the difference between the following two statements. if and if Thanks & Regards (3 Replies)
Discussion started by: tvkamesh
3 Replies

10. UNIX for Advanced & Expert Users

Simple Question

Friends, I did following exercise $ echo '' > test $ od -b test $ echo "">test $ od -b test $echo > test $od -b test Every time I got the following output 0000000 012 0000001 But 012 is octal value for new line character . Even though there is no apperent new line character... (6 Replies)
Discussion started by: j1yant
6 Replies
Login or Register to Ask a Question
simple_lock_try(9r)													       simple_lock_try(9r)

NAME
simple_lock_try - General: Tries to assert a simple lock SYNOPSIS
#include <kern/lock.h> boolean_t simple_lock_try( simple_lock_t slock_ptr ); ARGUMENTS
Specifies a pointer to a simple lock structure. You can declare this simple lock structure by using the decl_simple_lock_data routine. DESCRIPTION
The simple_lock_try routine tries to assert a lock with read and write access for the resource associated with the specified simple lock. The main difference between this routine and simple_lock is that simple_lock_try returns immediately if the resource is already locked, while simple_lock spins until the lock has been obtained. Thus, call simple_lock_try when you need a simple lock but the code cannot spin until the lock is obtained. To release a simple lock successfully asserted by simple_lock_try, call the simple_unlock routine. RETURN VALUES
The simple_lock_try routine returns one of the following values: The simple_lock_try routine successfully asserted the simple lock. The simple_lock_try routine failed to assert the simple lock. FILES
SEE ALSO
Routines: decl_simple_lock_data(9r), simple_lock(9r), simple_lock_init(9r), simple_lock_terminate(9r), simple_unlock(9r) Data Structures: slock(9s) simple_lock_try(9r)