Skip to main content

All Questions

Tagged with
1 vote
1 answer
548 views

/etc/passwd shows bash SHELL, but my terminal starts up in csh

I'm trying to determine what is setting the shell to csh when open a terminal and log in. From the information I've read, the default shell is set in /etc/passwd, and I see an entry in the /etc/passwd ...
user3731622's user avatar
0 votes
0 answers
266 views

recursive history search for tcsh shell

In bash shell, i generally use CTRL+R to fuzzy search a command that i executed recently. However the same doesn't seem to work for tcsh or csh shells. I want to understand if/how to do the same ...
Anuraag Tummanapally's user avatar
0 votes
1 answer
640 views

How to pass a variable to a sed command in a csh script?

Unix & Sed noob here! I have a requirement where I need to put a suffix ",waive" in case a line in a report containing a matching string.The matching string is part of another file "...
Aditya's user avatar
  • 3
1 vote
1 answer
416 views

How can correct these lines of sh script to avoid "syntax error: unexpected end of file"

#!/bin/sh init=step5_input rest_prefix=step5_input mini_prefix=step6.0_minimization equi_prefix=step6.%d_equilibration prod_prefix=step7_production prod_step=step7 # Minimization gmx grompp -f ${...
pkoduro's user avatar
  • 13
1 vote
2 answers
1k views

while command not working when bash script is sourced in tcsh?

I had made a bash shell script which include while command but when I run the script using source command on terminal, it gives a syntax error message. I need to use source because I have to set the ...
vikas's user avatar
  • 19
0 votes
1 answer
734 views

How to source a script code (set a variable) from another shell?

I tried to use FreeBSD. The FreeBSD root user uses csh by default. user@freebsd-13:~ $ echo $SHELL /bin/csh I know that setting a variable via $() does not work in csh. root@freebsd-13:~ # export ...
t7e's user avatar
  • 323
0 votes
0 answers
3k views

C-shell prompt color

I wan to change the color of my csh shell. I've edited my .cshrc file, following the instruction I've found here, and included this in it: set yellow="%{\033[1;33m%}" set end="%{\...
Mr.Seven's user avatar
0 votes
0 answers
46 views

How to check if the set variable has a file assigned to it with the help of if condition

#!/bin/csh -fx set my_path = "/cd/home/dir" cd $my_path set path1 = `ls -1 | grep "abc" | head -1` set path2 = `ls -1 | grep "def" | head -1` 1)#how to check if path1 ...
Suman Valsange's user avatar
0 votes
2 answers
2k views

call a .csh file from .sh file

Can I call a .csh script file from .sh shell script file? For example, I have a.sh, b.csh. Can I call b.csh in a.sh file? If so, how? I have tried writing this is ash file variable= source /path/to/b....
Suman Valsange's user avatar
0 votes
1 answer
310 views

why tcsh script choke on special characters inside file eg. #{ on a line is giving missing "}" error

I'm using tcsh shell script to read each line of a file input.txt script #!/bin/tcsh set out_file_length=`wc -l<$1` set i=1 while ( $i <= $out_file_length ) set each_line = `head -$i input....
saroop's user avatar
  • 1
3 votes
1 answer
2k views

csh/tcsh Tab Completion with "complete = enhance" Strange Behavior

set complete = enhance is put in .cshrc, and we have two files, test_ab_dd.c and test_abc_dd.c. If I type test_ab_<TAB> in the command line, csh DOES NOT autocomplete to test_ab_dd.c. It ...
allpan's user avatar
  • 33
0 votes
0 answers
368 views

Find and print permissions command in a csh file

Trying to create a .csh file that can find and display permission of the files in the directory. Using the following content of the script #!/bin/csh -b find . type -f \( -name "*.sh" -o -name "*....
sxa144's user avatar
  • 1
2 votes
3 answers
4k views

How can I dynamically change a path in my aliases?

I have a bunch of aliases in my .cshrc file which use the path: /projects/project_name/my_name/$CLIENT I've written a short script which is intended to take a folder name from my working directory ...
tombam95's user avatar
  • 121
0 votes
1 answer
213 views

Which of the following commands created a bash subshell

Which of the following commands created a bash subshell? bash bsh csh None of the above This question asked in recent exam and i was unable to answer. Can any one give me right ...
akki sharma's user avatar
2 votes
1 answer
695 views

How to use if on csh FreeBSD from test if file is older then X minutes

I have the following code working in Debian system's: for File in "${Files[@]}"; do if test "`find $FolderDownload/$File -cmin -190`" ; then echo "File is new then 3 hours" # Set ...
Wisdom's user avatar
  • 23

15 30 50 per page