...I tried ls, and cat but neither did anything. ...
Since you appear to be new here, I'd like to mention that the way to get the quickest responses is to actually cut and paste your commands and their responses from your terminal.
"xyz is not working" or "xyz does not do anything" are very vague statements; somewhat like calling your car mechanic and telling him "my car won't start". There could be a lot of reasons for that and the mechanic won't know what's wrong with your car unless he actually inspects it himself. It's the same thing over here.
In any case, here are the steps to install Cygwin from what I could remember; see if you followed them all.
(1) You have a working (non-corrupted) version of Windows and you downloaded setup.exe from the Cygwin website.
(2) If your computer is 32-bit, you downloaded the 32-bit version of setup.exe, or ditto for 64-bit.
(3) You double-clicked on setup.exe and clicked through the wizard to install Cygwin. In the final screen, it shows you an option to put up an icon on your Windows desktop. If you had checked that, you'd see the Cygwin icon on your desktop.
(4) Assuming that you do see the icon; if you double-click on it, the Cygwin shell would've opened up. By default, it is the Bash shell, and you'd see a "prompt". If you keep on pressing the "Enter" or "Return" key, you'd see the prompt printed repeatedly, because it is waiting for you to enter a command.
(5) Now, "ls" and "cat" are pretty basic commands, so they should be installed as a part of the core setup. If you've done everything till now as mentioned above, then run the following commands at your prompt:
and then
They should provide you some information about what "ls" and "cat" are in your system. Run those commands and paste their output over here.
(6) The "ls" command without any argument lists all the files (which includes directories in Unix/Linux) in the current directory. So if you are in an empty directory, "ls" won't print anything and you'll simply see your prompt printed in the next line. Maybe that's what you are confused about?
Try the following command:
This will print a long listing of all files, including hidden files, which in Unix/Linux are the ones that start with "." character. You should see atleast two lines printed. Post the output of this command over here.
(7) The "cat" command "concatenates" the contents of the files you pass as arguments.
- If you pass one argument, it will print the contents of that file.
- If you pass two arguments, it will print the contents of the two files one after the other. Ditto with more than two arguments.
- If you don't pass any arguments and press "Enter", it will simply wait for you to enter something. Once you enter something, it will simply echo your input.
Maybe that's what you saw?
Try this command:
If a file called "myfile" exists in your current directory, this command will print its contents. If it does not, it will show an appropriate error message. Cut and paste the output of that command over here.
Quote:
Originally Posted by Cambria
...
I tried running a program that I created which accepts command line arguments and prints them on screen. When I give it my argumeets in bash they always come up NULL, ...
Without knowing:
(a) what that program is
(b) what language it is written in
(c) how it was saved or compiled in your system
(d) how it was invoked by you
(e) how you passed the arguments to it
it is difficult to say why it came up with NULLs.
Let's say you saved your program in a file called "myfile". Then run the following command:
and paste its output over here.
And then copy and paste the command(s) you ran to invoke it and the response you received.
This User Gave Thanks to durden_tyler For This Post:
Experts,
I am newbie in shell scripting. I want to write Bash shell scripts corresponding to windows bat files. I have installed cygwin at c:\cygwin and i am trying to crate the sh file using vi editor. i am not able to understand how to use linux/unix convention for the code. following is my... (1 Reply)
Experts,
I am newbie in shell scripting. I want to write Bash shell scripts corresponding to windows bat files. I have installed cygwin at c:\cygwin and i am trying to crate the sh file using vi editor. i am not able to understand how to use linux/unix convention for the code. following is my... (15 Replies)
Im posting here as i posted this in the wrong section before, sorry about that.
Ok, im doing a self teaching course, im trying to understand how unix works, get and understand the basics before i hit the advance level.
Now i have this in windows, Btw im always new at windows so correct me if... (9 Replies)
Hmmm.... I love these forums because I always get great prompt responses and I want to ask a question about running bash on windows. Is that allowed?
Now I know I can install cygwin cron and run bash that way.
Can I run bash from windows schedule task? How?
thanks
siegfried (1 Reply)
Cygwin bash script was invoked in bash shell as follows:
/cygdrive/c/cygwin/bin/bash test.sh
This is content of my script
#!/bin/bash
#
exec 3</cygdrive/c/cygwin/home/work/part1.txt
read -u 3 x
echo $x
exec 3<&-
Commands work correctly when issued one at a time within bash shell.... (2 Replies)
I would like to the the windws8/cygwin/bash shebang feature to start a powershell script.
I do a "chmod +x set-sound.ps1"
and then at a bash prompt I do
./set-sound.ps1
The first line of ./set-sound.ps1
#!powershell.exe -ExecutionPolicy unrestricted
The result is the result:
... (5 Replies)
Is it possible to run a bash using a by creating an icon or shortcut in windows 7? Everything seems to be for unix or linux and unfortunately my institution is windows.
For example, run bash ~/newbatch.sh by clicking on an icon on a users desktop. Cygwin will be installed as well. Thank you... (8 Replies)
Hello
I have a problem with use bash script in windows task.
If I use script by cygwin it's working well.
If I use it by Windows task I'm get error
Error :
ERROR 2 (HY000) at line 2: File '.\xxx.csv' not found (Errcode: 2)
Code Line :
load data local infile './xxx.csv' REPLACE into... (16 Replies)
This line is called in a windows batch file and I need to call the same 3 jars with Parms in a bash script.
cd "D:\ACDRIP\JARS"
java -cp ".\RIPError.jar;.\RIP31.jar;.\RIP31msg_en_US.jar" ResubmitErrors -Ahost -P185050
pause
Any ideas how to do this in Bash? (3 Replies)