1
vote
2answers
120 views

How do I get Linux commands and scripts to work on Cygwin?

I'm back with a follow up question. How do I get Linux commands to work on Cygwin? First I asked you what tool should I use to help me run my Linux scripts on Windows and you suggested Cygwin and I ...
-1
votes
2answers
67 views

Execute a command for 3 lines at a time

I'm trying to run three separate processed while reading foo.txt Here is the example: cat foo.txt | while read line do echo line1 echo line2 echo line3 echo "" done The expected output is: line1 ...
8
votes
1answer
313 views

why doesn't a bash while loop exit when piping to terminated subcommand?

Why doesn't the command below exit? Rather than exit, the loop runs indefinitely. While I discovered this behavior using a more complex setup, the simplest form of the command reduces to the ...
-1
votes
1answer
18 views

How to create a command line tool to set up web projects?

I am web developer, and everytime I start a new project, I have to set up my folder structure and starter files by hand. Is it possible to write a small command line tool (Bash) that does this for me? ...
1
vote
3answers
95 views

Two simultaneous commands, then sequential commands?

So in Linux, I want to run a script 4 times, then do stuff to the output. I can do: script 1 > output1.txt script 2 > output2.txt script 3 > output3.txt script 4 > output4.txt cat ...
0
votes
1answer
92 views

Bash conditional redirection when testing/debugging

What is the best way to conditionally do a redirection in Bash for testing and debugging purposes? In my scripts I add a debug option to show what would have happened effectively doing a test run ...
2
votes
1answer
80 views

Invoke a script for every command typed at shell prompt?

On bash, is there any simple way to run a command every time another command is entered in your shell? I know about 'trap ... DEBUG', but unfortunately it does not run the specified code for every ...
1
vote
2answers
222 views

Prefix to each output of a command on runtime

I am trying to make a modular script. I have several scripts/commands which are called from a single script. I want to prefix the output of each separate command. Examle: My files are allcommands.sh ...
2
votes
1answer
84 views

How to get the result from bash auto-completion as a string?

What I'm looking for is not how to add autcompletion in bash for another program, but a way to get the result of what would have happened in bash to a string, basically: autocomplete "/etc/apa" ...
0
votes
1answer
20 views

What's the syntax to open a Tracker window from the command line in Haiku?

I've tried these: Tracker /path Tracker /path/ /path /path/ ...but no dice (the former two open Tracker's preferences window and the latter complain that /path is a directory.) What should I do? ...
0
votes
2answers
310 views

Root set environment variables

I have a small bash script which downloads a critical file, opens an SFPT connection, puts the file and closes the connection. As you can imagine, my script has some username and password information ...
0
votes
1answer
1k views

Can't edit '/etc/network/interfaces' file through bash script in Ubuntu [duplicate]

Possible Duplicate: sudo permission denied I got need to edit /etc/network/interfaces through bash script, I am doing something like below... sudo echo something > ...
0
votes
1answer
888 views

Advanced merge directory tree with cp in Linux

I need to: Copy all of a tree's folders (with all files, including hidden) under /sourcefolder/* preserving user privileges to /destfolder/ If there is a conflict with a file (a file with the same ...