Sponsored Content
Top Forums Shell Programming and Scripting New to Linux, have some simple question Post 302739245 by EasonRU on Monday 3rd of December 2012 09:57:23 PM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
RBASH(1)						      General Commands Manual							  RBASH(1)

NAME
rbash - restricted bash, see bash(1) RESTRICTED SHELL
If bash is started with the name rbash, or the -r option is supplied at invocation, the shell becomes restricted. A restricted shell is used to set up an environment more controlled than the standard shell. It behaves identically to bash with the exception that the follow- ing are disallowed or not performed: o changing directories with cd o setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV o specifying command names containing / o specifying a file name containing a / as an argument to the . builtin command o specifying a filename containing a slash as an argument to the -p option to the hash builtin command o importing function definitions from the shell environment at startup o parsing the value of SHELLOPTS from the shell environment at startup o redirecting output using the >, >|, <>, >&, &>, and >> redirection operators o using the exec builtin command to replace the shell with another command o adding or deleting builtin commands with the -f and -d options to the enable builtin command o using the enable builtin command to enable disabled shell builtins o specifying the -p option to the command builtin command o turning off restricted mode with set +r or set +o restricted. These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed, rbash turns off any restrictions in the shell spawned to execute the script. SEE ALSO
bash(1) GNU Bash-4.0 2004 Apr 20 RBASH(1)
All times are GMT -4. The time now is 03:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy