2
votes
2answers
115 views

Linux Shell fundamentals: How can I check the file descriptors status, (where are redirected to) right now without lsof?

I am learning about file descriptors for the case of Linux, and I was wondering if there is any command showing a complete list that allows me to know where is each one redirected to in this moment. ...
3
votes
1answer
100 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
1answer
277 views

Error not a valid identifierd when executing shell script [duplicate]

I have the following shell script in order to connect to database and do some tasks. echo Please enter userid: read USER_NAME echo "Please enter password:" read -s PASS SID=${ORACLE_SID} if [ ...
3
votes
2answers
388 views

how to grep for c:\

I'm using cygwin's grep to find all instances of hardcoded paths on c drive. doing: grep -r "c:\\" . gives grep: trailing backslash Does anybody know how I can do this?
3
votes
2answers
423 views

Change string occurrences in file while respecting DOS new line sequences

I use Visual Studio for my C# development while using Cygwin for some of the tasks that require scripting. Recently I wanted to change all occurrences of string AAA to BBB in my project's files. I ...
1
vote
1answer
2k views

For cygwin, how do I export the output in a terminal into a file?

I'd like to be able to export the output (and error messages) of my cygwin terminal in a file, especially since I have to click a lot of buttons in order to "mark" the stuff in the cygwin terminal ...
1
vote
3answers
1k views

How can we rename a file with semi-colon as part of the filename?

I tried to rename all file with extension "XLS;1" to "XLS" but it just didn't work. I tried the following in cygwin in windows xp and they don't work: mv *.XLS;1 *.XLS mv *.XLS\;1 *.XLS mv ...
1
vote
2answers
304 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: ...
3
votes
1answer
406 views

Git - remove deleted files

I'm using this simple git alias rmdel = "!git rm $(git ls-files -d)" meant "remove deleted", i.e. to remove from the staging area all files deleted from the file system. It works fine except ...