This is a follow-on question to the How do you use ssh in a shell script? question. If I want to execute a command on the remote machine that runs in the background on that machine, how do I get the ssh command to return? When I try to just include the ampersand (&) at the end of the command it just hangs. The exact form of the comman...
It is typical to have something like this in your cshrc file for setting the path:
set path = ( . $otherpath $path )
but, the path gets duplicated when you source your cshrc file multiple times, how do you prevent the duplication?
EDIT:
This is one unclean way of doing it:
set localpaths = ( . $otherpaths )
echo ${path} | egrep -i "$...
I'm writing a python script that executes a csh script in Solaris 10. The csh script prompts the user for the root password (which I know) but I'm not sure how to make the python script answer the prompt with the password. Is this possible? Here is what I'm using to execute the csh script:
import commands
commands.getoutput('server sto...
I am calling a csh script that the first thing it does is starts a new group.
I need to be able to see the standard output from the child process that is executed after the fork. I also want the parent process to 'hang' unitl the child process is finished.
Here is the script (razor_from_cgwin.sh).
(sort of)
newgrp name
source /stuf...
I am running a script on a solaris Box. specifically SunOS 5.7. I am not root. I am trying to execute a script similar to the following:
newgrp thegroup <<
FOO
source .login_stuff
echo "hello world"
FOO
The Script runs. The problem is it returns back to the calling process which puts me in the old group wit...
I'm trying to write a shell script that, when run, will set some environment variables that will stay set in the caller's shell.
setenv FOO foo
in csh/tcsh, or
export FOO=foo
in sh/bash only set it during the script's execution.
I already know that
source myscript
will run the commands of the script rather than launching a new...
Without using the new 2.6 subprocess module, how can I get either os.popen or os.system to execute my commands using the tcsh instead of bash? I need to source some scripts which are written in tcsh before executing some other commands and I need to do this within python2.4.
EDIT
Thanks for answers using 'tcsh -c', but I'd like to avoi...
I have a script where the user should be able to enter a string with spaces. So far I have:
#bin/csh
echo "TEST 1"
echo -n "Input : "
set TEST = $<
echo "Var | " $TEST
set TEST=`echo $TEST`
echo "Var after echo | " $TEST
set TEST=`echo $TEST | sed 's/ /_/g'`
echo "Var after change | " $TEST
If I enter the string "r r r" at "inpu...
I noticed that the bash shell can suggest command line switches for your command.
Just type your command, a dash (-) and type tab. The shell will show you available switches.
For example, try:
andy@andyx:~$ java -
and press tab - Surprise!
The question is:
How do I interface with this feature. I.e., if I write a program that is ...
I know this is lame way to do it. We need to capture a string that is dynamically generated in a Java program in the calling shell script and then use it later.
Also this is to be done in an existing csh file.
We considered the option of exporting it to an environment variable using putenv/setenv ... is that a better option? If so ho...
Hi All,
I know this question has kind-a started "religious" wars in past and there might not be one correct answer. But after working with ksh and csh for last 3-4 years and going through the pain of porting from one to another or applying a common piece of logic to multiple versions (read as legacy code), if I am writing a new script, ...
#!/bin/csh
@ cows = 4 - 3 + 1
echo $cows
This simple csh script when run produces "0" for output when I'd expect "2".
~root: csh simple.1
0
I did a bunch of looking and the only thing I could think of was that the "-" was being read as a unary negation rather than subtraction, therefore changing operator precedence and ending up wi...
Following up from my previous question, why is CShell so different from C?
4 - 3 + 1 = 2 in C.
4 - 3 + 1 = 0 in CShell.
Any ideas?
...
A simple example:
Let's say I have one alias being sourced somewhere as:
alias ls 'ls -o'
I'd like to have a second alias add on to this:
alias ls 'ls -a'
So that when I execute it, I'm really getting:
ls -o -a
Is this possible? Of course in the above example, the second overwrites the first.
Why would I want this? The first...
I want to get diffs on files in a specific pending changelist. I wish I could do this:
p4 diff -c 999
Can someone help me string together some csh magic to make this happen?
Maybe take the output of p4 opened -c 999 and piping it to p4 diff?
...
I love this shortcut in borne shell, and want to find out if it is possible to simulate and/or have (perhaps to install an add-on or with a script) it in csh or tsch
thanks
...
I would like to get the most out of working in cch or tcsh shell.
I am looking for general tips (post them away), online tips, or book.
Thanks
...
I tired head +10 and it didn't work. thanks
...
Basically I want do the following:
ls -l[+someflags] (or by some other means) that will only display files that are symbolic links
so the output would look
-rw-r--r-- 1 username grp size date-time filename -> somedir
-rw-r--r-- 1 username grp size date-time filename2 -> somsdfsdf
etc.
For example,
to show only direct...
Under windows, when I need to perform a basic calculations, I use a built-in calculator. Now I would like to find out what is the common way if you only have a shell.
Thanks
...