What is the command line to run a console application with input argument fed from text file?  text_file: This is a simple text file with characters and other symbols including tabs and new lines   The console should get  $./myapp "This is a simple text file with characters and other symbols including tabs and new lines"
121803
So usually I start a mongod process with 2 arguments like this  ~$ mongod --dbpath /media/nhuyvan1106/0CB6-189A/linux/mongodb/data --logpath /media/nhuyvan1106/0CB6-189A/linux/mongodb.  But I don't want to specify the arguments every time, so I saved them to a text file called mongo.txt with this following content.  --dbpath /media/nhuyvan1106/0CB6-189A/linux/mongodb/data --logpath /media/nhuyvan1106/0CB6-189A/linux/mongodb  Then I cat that file and pipe it through mongod like this  ~$ cat mongod.txt | mongod  But it does not work, mongod still uses the default value /data/db for the argument --dbpath and same for the other argument. Does any know how I can achieve this?
19083
I viewed  to redirect text to file while displaying the output. My question is how can I redirect it while working AND without constant | tee command.  My plan is to use  to identify terminal (Gnome or Guake) and record only Gnome for my Linux commands testing. So I need constant and immediate redirecting of commands and their outputs (with errors) to a file (say cmdlog.log).
96741
How can I create a message box from the command line, either GUI message boxes or message boxes shown inside the terminal? It would also be interesting to be able to get a simple input back from the user, for example, an input given with radio buttons (yes/no, OK, etc).
9812
How should I run another program from within my C program? I need to be able to write data into STDIN of the launched program (and maybe read from it's STDOUT)  I am not sure if this is a standard C function. I need the solution that should work under Linux.
113284
I have a file called -.  I want to display its contents.  One way is to do  cat ./-   since cat - reads from standard input. However, why are cat "-" and cat '-' also interpreted by the shell as cat -?
69323
I have the following commands that I want to have them all in one shell file:  su – s3 lizinfo.sh –b   when the first linex executes, it prompts and the command prompt become like as below:   -bash-3.1$ (here I cant type second command &gt;&gt; lizinfo.sh –b)   I want to have my shell file run all of these command at once. But when I run my shell file it only runs the first line and for does not run the second line, and waits until I enter it manually.  Would you help me please ?
84470
Suppose I have a bash shell script called Myscript.sh that need one argument as input.  But I want the content of the text file called text.txt to be that argument.  I have tried this but it does not work:  cat text.txt | ./Myscript.sh   Is there a way to do this?
64994
file contains just 1 line:  aaa   when I run "cat file" it mixes to username  user /dir : cat file aaauser /dir :   What could be the problem ?  Extra Info:  perhaps this is not properly set in bashrc ? ?  PS1='\u \W : '   UPDATE:  shouldnt there be a solution other than including a newline to the file ?  Why would there be no care for the elements that can distort the command line prompt ? ( by not having a new line )
53288
myscript [-a a-arg] [-c c-arg] [-b] [-e] somedirectory   Given that I want my shell script be invoked at the command line using the above parameters - where [these brackets] denote that they are optional - what is the best method to parse them?
21593
When you drop to the terminal via Applications -&gt; Terminal or Ctrl+Alt+F1 etc. bash is used by default to interpret your commands. If you wish to use another command interpreter (like zsh or fish), how do you get this to start as default?
80763
Typical Unix/Linux programs accept the command line inputs as an argument count (int argc) and an argument vector (char *argv[]). The first element of argv is the program name - followed by the actual arguments.   Why is the program name passed to the executable as an argument? Are there any examples of programs using their own name (maybe some kind of exec situation)?
51902
In Windows 7, when I start the Command prompt, is there any command to display the contents of an environment variable (such as the JAVA_HOME or PATH variables)?  I have tried with echo $PATH, echo PATH and $PATH but none of these work.
68999
Rather than rephrasing my question, let me describe to you the desired user-case:  I create a short shell-script to run command "gnome-terminal --someoptionflagname 'my text to be posted'", and execute this script.  Gnome-terminal pops up, with command-line prompt followed by my text.   ie: fields@mycomputer:/$ my text to be posted  Can this be done?
80371
What is the difference between redirection ./prog 2&gt;&amp;1 1&gt;file.txt and ./prog &gt;a.txt 2&gt;&amp;1? It looks that ./prog 2&gt;&amp;1 1&gt;file.txt doesn't save stderr to file but this ./prog &gt;a.txt 2&gt;&amp;1 does.
89847
I have a setup.bat file which install some applications and i want to execute it.  This is content of .bat file :  @echo off cls Rip_7z.exe x Rip0.7z cls del Rip0.7z cls Rip_7z.exe x Rip1.7z cls del Rip1.7z   I think the Rip_7z.exe file extracts the Rip0.7z and Rip1.7z files and builds the app.   How can I do this in the Ubuntu 11.04 Terminal?
12613
I often see tutorials on the web or posts on this site which make heavy use of the following characters at the command line. Often it seems that they are used for pretty similar purposes. What are the differences between them when used on the command line or for shell programming? For what purpose do I use which of them?  " " double quotes  ' ' single quotes  ` ` backticks
96943
I could use the either form to execute the cat method:  cat file_name cat &lt; file_name   The result is the same  Then I want to execute man in the format of stdin  man &lt; file_name   While file_name contains:  # file_name cat   But it pops up  What manual page do you want? instead of execute man cat.  I want to know why cat could accept stdin as arguments but man cannot.  And what's the difference between command line arguments and stdin?