tcsh

Selecting records with N fields from a file

can somebody help me, how can I filter my file, inside the file I have rows with 3, 4, 5 elements, I want print using echo only these which have 5 elements, thanks in advance (I'm talkin about scripts) ...

transferring via pipeline

I need to transfer data via pipe and also transfer file with this data, can I do something like this inside the script? cat ${1} | ./helper ${1} and what is the difference if I write cat ${1} | ./helper < ${1} ...

how does pipe work

hello, explain me please how exactly pipe works, for example I have this snippet of the code set line = ($<) while(${#line} != 0) if(${#line} == 5) then echo line | sort | ./calculate ${1} endif set line = ($<) end I need to choose all rows with 5 words and after sort it and after transfer, but I'm confused, how will it work,...

problem with script

I'm workin on C-Shell, can somebody help me find the bug, my script: #! /bin/tcsh -f cut -d" " -f2 ${1} | ./rankHelper script rankHelper: #! /bin/tcsh -f set line = ($<) while(${#line} != 0) cat $line set line = ($<) end file lines from which the data was sent: 053-3787837 038280083 052-3436363 012345678 053-3232287 038280083 05...

from string to integer (scripts)

I have this snippet of the code: set calls = `cut -d" " -f2 ${2} | grep -c "$numbers"` set messages = `cut -d" " -f2 ${3} | grep -c "$numbers"` @ popularity = (calls * 3) + messages and error @ expression syntax what does it mean? grep -c returns number, am I wrong, thanks in advance in $numbers I have list of numbers, 2 and ...

grep options (unix)

hello everyone, can You explain please, can grep pick rows if at least one element from the list appeared, for exmaple grep "hello world" file1 grep must give me all rows which have or word hello or world or both of them, thanks in advance ...

problems with cut (unix)

hello everybody, I've got strange problem with cut I wrote script, there I have row: ... | cut -d" " -f3,4 >! out cut recieves this data (I checked it with echo) James James 033333333 0 0.00 but I recieve empty lines in out, can somebody explain why? ...

continue in unix

hello, I'm writin scripts and I'm very curious, does c-shell have somethin like continue in C, thanks in advance ...

error in Unix (scripts)

somebody knows what does this error mean? Missing -. in google I found nothing about this ...

What the most efficient way to grab the bibliograpy name from a latex file via unix shell commands?

I am trying to write a shell script that compiles a latex source. I wish to grab the name of the bibliography file which is contained in a command like: \bibliography{filename} I need to save "filename" to a shell variable. My solution to this (in tcsh) is dreadfully embarrassing: set bioliography=grep -v -E "[[:blank:]]*%[[:blank:]]*...

Vim hanging after parsing .vimrc (even a blank one) file on Solaris 10

Hello all, I am having a problem with vim 7.2 hanging (for about 10 seconds) after it parses the .vimrc file. I had a similar issue in the past with tcsh on linux, but it was resolved by setting TERM to xterm-color. The same does not resolve the issue here. Any idea what may be causing this? $ env USER=redacted LOGNAME=redacted HOME=...

Is there a way to make this perl code capture stderr as well as stdout from a tcsh?

open UNIT_TESTER, qq(tcsh -c "gpath $dir/$tsttgt; bin/rununittests"|); while(<UNIT_TESTER>){ reportError($ignore{testabort},$tsttgt,"test problem detected for $tsttgt:$_ ") if /core dumped/; reportError($ignore{testabort},$tsttgt,"test problem detected for $tsttgt:$_ ") if /\[ FAILED \]/; writelog($tstt...

How to run a tcsh shell command and selectively ignore the status?

I've got a tcsh shell script that I would like to stop with an error on nonzero status most of the time, but in some cases I want to ignore it. For example: #!/bin/tcsh -vxef cp file/that/might/not/exist . #Want to ignore this status cp file/that/might/not/exist . ; echo "this doesn't work" cp file/that/must/exist . #Want to stop if th...

Bash's equivalent of Tcsh's ESC-p to jump to command starting with what you typed so far.

I recently made the insanely long overdue switch from tcsh to bash. The only thing I miss is tcsh's ESC-p feature: Start typing a command and then hit ESC-p (I actually found the equivalent ctrl-[p easier to type) and it jumps to the most recent command in your history that starts with what you've typed so far. Perhaps the best answer i...

Deleting email automatically

Hey Guys, The Problem: I'm looking for a way to create a program that visits an email host site and log in with a specific credentials and deletes all message at the Inbox and clears the Trash folder. Background: I have an email with my domain and that email is hosted on some ISP server. However I have enabled auto-forward all my ema...

Cshell commands

When I receive lines one by one, why do programmers sometimes write: set line = ($<) set line = ($line) What exactly do those rows mean? ...

How to determine the current shell i'm working on ?

How to determine the current shell i am working on ? Does ps command output will alone do ? How to do this in different flavors of UNIX ? ...

What is "q.v." in the tcsh man page

Ok, this has been an on-going annoyance, so naturally I thought to bring it here. In the tcsh man page the phrase q.v. is used, and I have no clue why those four characters are inserted. Is it self referential ? a technical reference ? a documentation or language convention ? Here are some examples in context. (+) Variables may be ...

Enable History Logging In TCSH Shell

How can I enable logging of all the commands entered in the tcsh shell? I've tried: Setting the $history variable to 100. The $savehist to 99. Set the $histfile to $home/.history Typing commands into the shell doesn't save the commands in the history file. ...

Tcsh and Bash Initialization

I would like to be able to source a file to set up some environment variables, but do it so it's independent of the shell being used. For example %: source START.env # START.env if [ $SHELL == "bash" ]; then source START.env.bash # sets environment variables else source START.env.tcsh # sets environment variables fi However, t...