0
votes
1answer
25 views

understand the output of stty -a and change ctril backspace to just backspace

I am working in bash shell on a Solaris environment and whenever I type "backspace" it clears out the entire line. Do you have any suggestions for me to change the backspace clearing entire line to ...
3
votes
1answer
63 views

Read the files in shell script doesn't print out anything?

I am trying to read a file from shell script line by line. Below is my file content - hello=world And below is my shell script that I have written - #!/bin/bash while read -r line; do ...
1
vote
2answers
32 views

How to run bash on CYGWIN

I have created following file with name test.sh #!/bin/bash name = "Elvin John Paul" echo $name echo ${name#* } echo ${name##* } echo ${name% *} echo ${name%% *} and I am getting some error as ...
2
votes
3answers
261 views

Command substitution in for loop not working

I want to keep all files not ending with .bat I tried for f in $(ls | egrep -v .bat); do echo $f; done and for f in $(eval ls | egrep -v .bat); do echo $f; done But both approaches yield the ...
1
vote
1answer
412 views

Changing title without changing prompt on Cygwin

I have the following shell script function from this site that allows me to change the title in both Putty and Cygwin. In Putty connected to a Linux host it changes the title and leaves the prompt as ...
1
vote
2answers
555 views

Trouble with read line script in Cygwin

I'm on windows 7 using Cygwin. My script and text file are located in the same directory. #!/bin/bash while read name; do echo "Name read from file - $name" done < /home/Matt/servers.txt I get ...
3
votes
3answers
155 views

Delete all but largest file of specific type

I am trying to organise the album art in my music collection so that only one image is assigned to each folder. My directory structure currently looks like: /path/to/music/Album Name/ ...
3
votes
1answer
211 views

Pausing rsync via bash script?

Is there a way to pause rsync via command line, if it transfers data for over X minutes? I'm working on using it as a backup and would like it to pause every once in a while to prevent the hard disks ...
2
votes
2answers
543 views

Cygwin: readline lib loaded in different locations

Within cygwin, almost each unix command I type prints a warning message, takes time and eventually gives a correct result: -bash-4.1$ ls 0 [main] bash 7468 child_info_fork::abort: cygreadline7.dll: ...
2
votes
1answer
147 views

Is there a way to control the speed at which Curl reports progress?

I'm using Curl in Cygwin to automate a daily download. I want to keep progress in a log but Curl is just a little too noisy for my taste. I tried man curl and Google, but didn't find anything. Can I ...
5
votes
1answer
756 views

Why is Cygwin not sourcing my .bashrc?

I'm switching to Cygwin from the bash shell that ships with Git for Windows, and for some strange reason the .bashrc file is not being sourced when I open a new Terminal. I have to source .bashrc ...
2
votes
1answer
805 views

How do I preserve the history file of cygwin bash across independent sessions?

So my home directory does have a .bash_history file, but it refuses to grow any bigger for some reason. I've already changed the .bashrc settings to set the history size to 99999 and the history file ...
3
votes
1answer
255 views

Why are these aliases failing?

I am attempting to put some alias definitions in .bashrc. Like this: #Convienience aliases alias ll='ls -l' alias ldir='ls -p | grep "/"' #Temporary aliases alias mvFooLog='mv ~/Projects/Foo/Log.txt ...
1
vote
2answers
276 views

need portable crontab host-checking/failover logic across Linux & Cygwin

A host-ping test that always works correctly from the interactive bash command line in Cygwin, is behaving incorrectly in its own crontab--always selecting the second host--and I can't figure out why: ...
2
votes
1answer
210 views

Why doesn't my new cygwin .bashrc interactive check work?

I just updated Cygwin and the new .bashrc contains this line right at the top: echo "BEFORE TEST" # If not running interactively, don't do anything [[ "$-" != *i* ]] && return echo "AFTER ...
-1
votes
3answers
1k views

printf white space character in bash script

How can the white space character be escaped in printf for the purpose of this script that currently runs in a Cygwin client? The line containing the whitespace (which by itself works from the command ...
6
votes
2answers
5k views

How to alter PATH within bash script?

I have several projects that require me to change versions of Java/Grails/Maven. I'm trying to handle this with some Bash scripts that would make the changes. For example: #!/bin/sh export ...
1
vote
1answer
451 views

How can I make custom key bindings work even while SSH-ed into another machine?

I've added "\eOD": backward-word "\eOC": forward-word to my .inputrc to get ctrl-arrow key mappings sorted out in Cygwin allowing me to move forward and back fine. When I SSH to any other Linux ...
1
vote
2answers
557 views

Alias in cygwin bash doesn't seem to run in the right order

I am trying to create an alias to use in my Cygwin shell to determine if the Mercurial-managed directory I'm currently in has outstanding changes. The command "hg st -m" lists all modified files. ...