knowing the shell & fc command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers knowing the shell & fc command
# 1  
Old 09-09-2004
knowing the shell & fc command

i use solaris 5.8 & sco release 5

please answer the 2 queries

1) how to know, in which shell are we in?

2) how to use the fc command in different shells?

replies as usual are greatly appreciated.

raguram R
# 2  
Old 09-09-2004
Quote:
1) how to know, in which shell are we in?
echo $SHELL
2) how to use the fc command in different shells?
man fc
# 3  
Old 09-10-2004
DEV|rram!pwd
/u2/rram
DEV|rram!echo $SHELL
/bin/sh
DEV|rram!fc -e vi -10 -1
fc: not found
DEV|rram!

this is what when i use the "fc" command. pl. help.

raguram R
# 4  
Old 09-10-2004
You will need to switch to ksh to use the fc command. Switching to ksh is a great idea. But not for the fc command. I love ksh but I never use the fc command. Dave Korn has said that he would leave fc out if he could start over.

Instead of the fc command, do either:
set -o emacs
or
set -o vi
then its like you're using one of those editors to enter the commands.
# 5  
Old 09-13-2004
I like aliasing "r" to "fc -e -" on my boxes, when using bash. That's the only time I use "fc" though. (And I know bash has it's own history functions anyway using the bang (!) but old habits die hard!)

Cheers
ZB
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell command to transpose Row & Column

Hi all, need a help with getting a one line command to do the following. i have an input file with rows of data containing credits for each office, the output should be one row for each office with all the credits in rows for that office, if its not there then it should say N/A. the credits are... (10 Replies)
Discussion started by: tech_frk
10 Replies

2. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

3. Shell Programming and Scripting

If && command giving wrong output

Hi All, I am trying to run a script which will search for 2 strings(stopped,started) in a text file and echo an output depending on below condition -bash-3.2$ cat trial1.txt v ggg f -bash-3.2$ cat trial1.sh VAR9=` grep 'stopped' /tmp/trial1.txt` VAR10=` grep 'started'... (4 Replies)
Discussion started by: srkmish
4 Replies

4. Shell Programming and Scripting

Read input while another command is running &&

This script runs tshark, then displays the output. I want to read a keypress at all times throughout this script, especially during the 10 seconds that tshark is running. This code however, only takes input before tshark runs. #!/bin/bash main() { while (( "1" == "1" )) ; do keypress &&... (3 Replies)
Discussion started by: Kiah07
3 Replies

5. UNIX for Dummies Questions & Answers

Implement the '&&' function in a shell

Hello, I'm currently implementing the && function in a shell using C. For example, if we input cmd1 && cmd2, then cmd2 executes only when cmd1 exits successfully. I'm thinking about: int main() { int i; char **args; while(1) { printf("yongfeng's shell:~$ "); args =... (5 Replies)
Discussion started by: Yongfeng
5 Replies

6. Shell Programming and Scripting

[Solved] BASH - chaining TEST and COMMAND with && and II

Can you explain what this line of script is doing. What I have understood is : -- variable C is the name of a software which is either not installed, so it must be installed or allready installed and then should be update if newer version found -- branch B="$B $C" is to install the software --... (4 Replies)
Discussion started by: jcdole
4 Replies

7. UNIX for Dummies Questions & Answers

Problem with xterm & tcsh & sourcing a script in a single command

Hi friends, I have a script that sets the env variable path based on different conditions. Now the new path variable setting should not done in the same terminal or same shell. Only a new terminal or new shell should have the new path env variable set. I am able to do this only as follows: >cd... (1 Reply)
Discussion started by: sowmya005
1 Replies

8. UNIX for Dummies Questions & Answers

sleep 10 && command doesn't work

Hi there, I found a trick to easily postpone a command by a few seconds: supernova:~# sleep 10 && command &If you logout, the command should still be executed... But not all the time. Could anyone of you explain me why the following command is executed even after logging out: supernova:~# sleep... (2 Replies)
Discussion started by: chebarbudo
2 Replies

9. Shell Programming and Scripting

Knowing the shell, no using $SHELL variable

How I can Know the shell type for a session?? I don't want use the $SHELL variable because this return (for example) "/bin/ksh" and I need some just like "ksh" in my script... I need just the shell type and not the path.... Exist any command for this??... Thanks!! (3 Replies)
Discussion started by: gloprest
3 Replies

10. UNIX for Dummies Questions & Answers

grep command & shell procedure's

hello, i'm trying to pluck words from a list that have exactly 3 occurances of a specified letter. I've come up with this : grep -i .*$1.*$1.*$1.* But this also selects words with 4 or more, any tips? I'm putting this into a shell procedure and want to be able to add a switch before I put the... (1 Reply)
Discussion started by: stevox
1 Replies
Login or Register to Ask a Question