0
votes
1answer
44 views

grep: Invalid back reference for date expression in tcsh

I googled for the following error, and didn't get any great explanations as to what was going on with grep under tcsh. (Yes, that date expression exists in the log files). $ grep '2014-07-21' *.log ...
0
votes
0answers
22 views

linux 'precmd' error: endif: Too many arguments

I want to redirect the command lines that match a string into a file. for example, suppose i want to grep 'man' on the command lines i type and redirect(append) into a file. I am trying to use the ...
1
vote
4answers
99 views

rm matching file names by pattern

I have 42000+ Project Gutenberg epubs. Often a release has both an images version and a no-images version. I want to remove the no-image copies if there is an image copy. ... pg16045-images.epub ...
6
votes
0answers
182 views

How to make auto complete available for directories in cdpath for tcsh?

I just learned the trick for setting up cdpath in tcsh and it looks pretty useful. However seems auto-complete of sub-folder names doesn't come with it, is there any trick available on that? It'd be ...
0
votes
1answer
1k views

Running commands as another user on their machine via ssh?

As part of my normal workflow I ssh into another user's machine, switch user to them, run a command, then exit out to my own machine again: ssh hostname sudo su user runcommand exit exit Is there a ...
0
votes
2answers
453 views

Suppress 'Warning: no access to tty' in ssh

I have a short simple script, that compiles a .c file and runs it on a remote server running tcsh and then just gives back control to my machine (this is for school, I need my programs to work ...
0
votes
2answers
199 views

Copying a template header to multiple existing files

I have a bunch of *.csv files that use headers. Right now the files have headers and the same number of lines of data. I need to erase the data in these files, so I figured I could just overwrite the ...
1
vote
2answers
136 views

How do I make an alias work when I need to invoke more than one binary in the same command?

Say I have two binary files: binary1 and binary2. Each of them has its own option set: options1 and options2. Users need to invoke a command that follows this structure: binary1 options1 binary2 ...
1
vote
1answer
511 views

Linux: How to eval the contents of STDOUT?

Consider you have a file with some sort of terminal command. How might each line be executed? Can you pipe the output of more into an eval? %> more ./foo.txt Edit: After some help/guidance ...
3
votes
1answer
850 views

How to get rid of errors when running find command in Linux?

I am using following command to list out 20 large files in a directory. But along with the file listing, it also shows error messages, such as permission denied. I tried adding 2> /dev/null but it ...
0
votes
2answers
172 views

Ignore variables from another shell

I am on a linux workstation in a network, with an "old" distrib. Furthermore, login shell is enforced to CSH. I already asked to Admins if it would be possible to switch to another one (I would like ...
0
votes
2answers
578 views

Opening new terminal window does not pick up .cshrc

I am using KDE and Konsole. When I open a new tab, it does not pick up my .cshrc in my home directory. I am using tcsh. How I do I force re-loading of the .cshrc in my home directory without having to ...
4
votes
3answers
6k views

Redirect stdout to stderr in tcsh

From my understanding, the following should send 'test' on standard error in tcsh: echo test >&2 However, it instead writes 'test' to a file named 2, and when I look through my history, I ...
3
votes
1answer
277 views

How to save shell history more conveniently in tcsh?

I'm using tcsh quite extensively and have several questions about it's history: Is there a way to save commands for different shell tabs separately? Is there a way to save commands by session (for ...
1
vote
1answer
371 views

cd Command Linux and Mystery Flags

Platform: CentOS 6.2 Shell:tcsh I'm playing around with cd for a BASH script, and noticed the wondrous cd - option, but was left with many questions... Why the cd -? Isn't this redundant with cd ...
0
votes
2answers
81 views

Running the output of script, and checking for consistency

Given a file that was output by script, is there a way to run all of those commands in order, and then check to see if the output matches what was in the script file? I assume that diff can be used ...
1
vote
2answers
934 views

get value of an alias in bash

I recently switched from tcsh to bash, and I'm used to being able to do things like sudo `alias netstat` but since alias gives name=value in bash, I can't do this anymore. Is there an equivalent in ...
2
votes
2answers
381 views

How to get linux to stop asking “There are # rows, list them anyway? [n/y]” for auto-completing

How do I get tcsh to stop asking if I want to list files in a directory that may have a lot of auto-completes? For example, if I do: xemacs ../"TAB" to get the list of files it asks: There are ...
2
votes
2answers
602 views

On Linux (CentOS 5), remembering when we've followed a symlink and being about to 'cd ..' out again

I'm trying to figure out how to tell the shell (tcsh) to remember when I've gone into a symlinked folder, and allow 'cd ..' to navigate back out of the symlink rather than just navigate to the parent ...
1
vote
1answer
783 views

In tcsh, how do I disable spelling correction of my command?

Recently, when we updated our OS, we got a new tcsh feature enabled by default. Whenever I type a command that tcsh doesn't recognize, I get an annoying spelling correction like: % cats ...
2
votes
2answers
146 views

Is this alias any useful?

I am going through and old .cshrc file and it contains the following alias: alias pwd 'echo $cwd' How is that useful? I used to think that this is how pwd might have been implemented. But looks ...
2
votes
2answers
1k views

How to open xterm shells with background colors based on topographic positioning?

I currently use an alias in csh/tcsh to open shells with specific window colors. Example: xterm -geometry 105x25 -font 8x13 -bc -bg #333 -fg #999 \!* & What I'd like to do is have one command ...
0
votes
3answers
1k views

run tcsh but bash started instead

I tried to start a tcsh on my Fedora 7 (default shell is bash) [ss@ssvm ~]$ tcsh [ss@ssvm ~]$ echo $SHELL /bin/bash As you see, another bash shell started. I looked at the tcsh file: [ss@ssvm ~]$ ...
1
vote
5answers
5k views

linux text editor for windows

can somebody recommend a good Linux text editor for Windows (if it exists), I wrote scripts for C-Shell using txt editor of windows but I have problem, it doesn't run because windows is not UNIX, what ...
1
vote
4answers
2k views

Using regular expressions and tail to execute a command

Similar to this question, in Linux tcsh I want to tail a log file and when I match a regular expression I want to execute an arbitrary command. How can I do this?
0
votes
3answers
2k views

Space in Directory Path in $path Variable in Linux

I am using Red Hat Enterprise 5.3, and I'm trying to add a directory to my $path variable, but it has spaces in it. The $path variable is space delimited, so how do I differentiate a space in a ...