Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Cygwin bash script and read command Post 302413530 by pludi on Friday 16th of April 2010 04:11:37 AM
Old 04-16-2010
Windows environment != Cygwin environment
The variable you read in the first line is set only within that bash process, and is lost as soon as it exits (which is immediately afterwards)
You can put multiple independent statements on the same line by separating them with a semicolon, OR you could go the smart way, and put all needed statements into a script which you then call.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to use cygwin to run bash script

Hi, all, I try to run a quite simple bash script mytest.sh in cygwin, it's content is: #!/bin/bash echo "It is my first bash shell" there are three lines in the script. The second line is blank line. When I run it use command: bash c:/mytest.sh, ... (6 Replies)
Discussion started by: Jenny.palmy
6 Replies

2. UNIX for Dummies Questions & Answers

cygwin bash startup command weirdness (part 1)

I am running (I believe) the latest stable version of cygwin CYGWIN_NT-5.1 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin on a win xp sp2 laptop. Suppose, to make things simple for now (but I may do a part 2 posting...), that I am in a dos shell, and I want to create a bash shell and have it... (1 Reply)
Discussion started by: fabulous2
1 Replies

3. Shell Programming and Scripting

BASH: Script jams Cygwin to 100% CPU -

I'd like to streamline the code more than a bit to get it to run faster. There's a thread about this and related issues of mine on the Cygwin mailing-list, but I want to eliminate any chances it might just be inefficient/inelegant/crappy code. A previous run of the same script on both Cygwin and... (6 Replies)
Discussion started by: SilversleevesX
6 Replies

4. Shell Programming and Scripting

bash command in makefile (cygwin)

Hello, In my make file (make 3.81), I use a combination of shell commands to automatically create the name of my build directory. OS := $(shell uname -s) ARCH := $(shell uname -m) KERN := $(shell uname -r | cut -d. -f 1,2) BDIR := $(OS)_$(KERN).$(ARCH)When I boot into different OSs, I... (7 Replies)
Discussion started by: LMHmedchem
7 Replies

5. Shell Programming and Scripting

redirect time command output to file (cygwin bash)

I have set up a bash script to run a long list of things that I need to time. I would like to redirect the output of time to a file. I have set it up like, echo "Runtimes for servlet 4, 100K structures" > test_times.txt echo "" >> test_times.txt echo "runs where N=10" >> test_times.txt echo... (7 Replies)
Discussion started by: LMHmedchem
7 Replies

6. Windows & DOS: Issues & Discussions

run cygwin bash script from notepad++

I'm using Notepad++ to edit my BASH scripts and using CYGWIN to run them from Windows7. In Notepad++ there is a 'Run' capability. How do I get this to run my scripts directly without having to enter the script name from the Cygwin command line? (3 Replies)
Discussion started by: millsy5
3 Replies

7. Shell Programming and Scripting

Cygwin bash script to unmount and mount an XP partition

As stated, I am looking into keeping my backup drive unmounted in normal windows use. Partly this is to address threats like cryptolocker. Since one of my backup drives is an internal drive, it will not likely afford any protection from such a threat. I am thinking of adding code to my rsync script... (5 Replies)
Discussion started by: LMHmedchem
5 Replies

8. Shell Programming and Scripting

Bash script - cygwin (powershell?) pull from GitHub API Parse JSON

All, Have a weird issue where i need to generate a report from GitHub monthly detailing user accounts and the last time they logged in. I'm using a windows box to do this (work issued) and would like to know if anyone has any experience scripting for GitAPI using windows / cygwin / powershell?... (9 Replies)
Discussion started by: ChocoTaco
9 Replies

9. Shell Programming and Scripting

Bash Script (tar + md) on Cygwin

Hi everybody, First, I'm sorry for my bad english! I have the following situation: I have a Windows 2012 R2 with Cygwin installed. The Windows Server is used as a backup Server with Dell AppAssure installed. At the moment, AppAssure saves Backup Targets to a repository on his D. The... (9 Replies)
Discussion started by: fibra3000
9 Replies

10. UNIX for Beginners Questions & Answers

Using BATCH to call a BASH script on CygWin

I am trying to use a batch file to automatically execute a bash script with no luck this far. The batch script looks like this: C:\Cygwin64\bin\bash test.sh I have also tried this: C:\Cygwin64\bin\bash "C:\Cygwin64\bin\test.sh" Needless to say that the windows box has Cygwin... (7 Replies)
Discussion started by: Xterra
7 Replies
scl(1)							      General Commands Manual							    scl(1)

NAME
scl - Setup and run software from Software Collection environment SYNOPSIS
scl <action> <collection1> [<collection2> ...] <command> scl <action> <collection1> [<collection2> ...] -- <command> scl {-l|--list} [<collection1> <collection2> ...] DESCRIPTION
This manual page documents scl, a program which is an utility for running software packaged as a Software Collection. scl utility allows to execute an application which is not located in the filesystem root hierarchy but is present in an alternative loca- tion. This application can still use and benefit from software installed in the root filesystem. In order to let an application be visible to the system one has to use scl utility as an interface. <action> is a script name to execute in a bash environment before the application itself takes in executed. Currently only enable scriptlet is mandatory which is needed to update search paths, etc. One can enable more Software Collections if needed and therefore one can use multiple collections which are enabled by the left-right order as present on scl command-line. <command> is an arbitrary command or set of commands to execute within the Software Collection environment enabled. Control is returned back to the caller with the original environment as soon as the command finishes. If <command> is '-' (dash) then it is read from the stan- dard input. Note: if you use <command> consisting of multiple arguments, you either need to use quotes or the -- command separator. Everything that follows the separator will be considered a command or its argument. Note: some commands modify user environment in some way. Those commands may potentially break SCLs, as their activation also usually depends on env. modification as well. Typical examples of such commands are su and sudo. Every collection modifies the environment differ- ently, thus more details may be found in the documentation of the particular collection. OPTIONS
-l, --list Lists all installed Software Collections on the system. -l, --list <collection1> <collection2> ... If a collection name is specified then list of installed packages belonging to the collection is listed. EXAMPLES
scl enable example 'less --version' runs command 'less --version' in the environment with collection 'example' enabled scl enable foo bar bash runs bash instance with foo and bar Software Collections enabled cat my_command | scl enable baz - run set of commands listed in my_command file in the environment with baz Software Collection enabled scl -l list all installed collections scl -l example list all packages within example collection AUTHOR
scl was written by Jindrich Novy <jnovy@redhat.com> and Jan Zeleny <jzeleny@redhat.com> scl(1)
All times are GMT -4. The time now is 07:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy