LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   i dont like bat files (https://www.linuxquestions.org/questions/slackware-14/i-dont-like-bat-files-888859/)

spooge 06-28-2011 05:56 PM

i dont like bat files
 
i work at home too, unfortunately my software requires winblows. fortunately i have a Slack box running 24/7 by my side.

i wrote a simple bash script(grep/sed..) today and like to use it.

is there any way to access the script through winblows7 besides using putty....? i'd like a fast click and done ??

dugan 06-28-2011 05:57 PM

Cygwin?

spooge 06-28-2011 06:10 PM

hmm. guess i should do some reading on this. looks ok so far.
how about a briefing on this?

all i want to do is run a Bash script on my Slack server.

kfritz 06-28-2011 07:19 PM

PuTTy really is your friend...if you use the more advanced features.

Install the full-blown putty that includes pageant, plink, puttygen. Use puttygen to generate a key and put it in your Linux ~/.ssh/authorized_keys. If you add a pass-phrase, then run pageant and give it your pass-phrase. The you can run commands remotely using plink. For example, I have a .cmd file on my desktop to launch a remote packet capture and display it locally in Wireshark:

Code:

plink.exe -i "c:\Documents and Settings\kfritz\My Documents\mykey.ppk" root@10.1.3.88 "tcpdump -p -s 0 -U -n -w - -i eth0 not broadcast and not port 22" | "\Program Files\Wireshark\wireshark.exe" -kHSl -i -
Same concept can be used to run any command on the remote server.

Woodsman 06-28-2011 07:40 PM

The others have mentioned cygwin and putty.

Quote:

all i want to do is run a Bash script on my Slack server.
I run some Windows systems in a VirtualBox virtual machine (VM) and use bridge networking for those VMs. I also have one physical Windows machine that connects to the same LAN and Slackware host machine.

I connect my Windows systems to my Slackware host using Samba. All of my data files are Samba shares that I keep stored on my host Slackware system. My Windows systems auto-connect to those Samba shares. Most of the script based tasks I run in support of my work are actually system scripts rather than Windows specific. Therefore my shell scripts running on my host Slackware system can perform maintenance without ever needing the Windows machines.

If your shell script task is in that category, then perhaps some Samba shares might suffice for you? For example, if you are a web developer and want to search and replace text within files using find/grep/sed, you can do that easily with a shell script if all of the data files are on the host machine and shared through Samba.

If not and the task needs to run directly within Windows, then another option might be the Windows Power Shell. No experience, but perhaps that environment might provide a more flexible language and syntax to write 'nix-like scripts.

spooge 06-28-2011 10:33 PM

cool. thanks guys. my brain is thinkin now.
tomorrow i'll work my script a lil more then when i get home( i didnt say i was gonna work on this at work...cough)i'll try the above.
so far i used putty for tonight's work.
installed cygwin... <- a tomorrow project

my situation:
i'm designing, and programming(part/mold design, program CNCs). my post isn't just right(yet). i was manually editing the files(sometimes up to 10 files). finally i had time to modify an old script i had to my 'now' situation. a simple routine edit.
grep and sed does the job in seconds compared to minutes.
Using Pro E, a few versions ago Linux was supported...Unix is still, might have to go there soon.

Thanks again!!

allend 06-29-2011 12:22 AM

You can also get versions of grep and sed that run natively on Windows. http://gnuwin32.sourceforge.net/packages.html

+1 for Cygwin
It does take some effort to get going, but is likely to repay the effort.


All times are GMT -5. The time now is 09:43 AM.