Help with bash scripting in cygwin

Hi,

I am trying to write a bash script, to open firefox and then open a local webpage in a tab. This is a shell of what I have

#! /bin/sh
alias firefox='/cygdrive/c/Program\ Files/Mozilla\ Firefox/firefox.exe'
$URL='/cygdrive/d/Playback.html'
firefox &
sleep 1
for i in 1 2 3 4 5 #6 7 8 9 10
do
echo $i
for j in 1 #2 3 4 5 #6 7 8 9 10
do
echo $j
firefox -new-tab $URL
done
done

From what I understand, I think bash cannot read the file in /cygdrive/d/Playback.html as it doesnot understand the /cygdrive partition. I tried the windows notation as well, which didn't work. Could someone help me in doing this.

Thanks.

---------- Post updated at 02:55 PM ---------- Previous update was at 02:42 PM ----------

Just realized my mistake. Stupid. I was using $ in the assignment statement.

#! /bin/sh
alias firefox='/cygdrive/c/Program\ Files/Mozilla\ Firefox/firefox.exe'
URL="D:\Playback.html"
firefox &
sleep 1
for i in 1 2 3 4 5 #6 7 8 9 10
do
echo $i
for j in 1 #2 3 4 5 #6 7 8 9 10
do
echo $j
firefox -new-tab $URL
done
done

If you are not sure there is always a back door...
Poet and I didn't know it...

This launches Explorer from a cygwin terminal:-

AMIGA:~> cd /cygdrive/c/windows
AMIGA:/cygdrive/c/windows> cmd.exe
Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\windows>start explorer.exe
start explorer.exe

C:\windows>exit
exit
AMIGA:/cygdrive/c/windows>_

A simple shell script to do the same:-
(Don't forget to remove carriage returns, dos2unix...)

#!/bin/sh
# runexp.sh
cd /cygdrive/c/windows
cmd.exe /C "start explorer.exe"
exit
1 Like