The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
simple shell - how to get a parameter typed in a shell script cmitulescu Shell Programming and Scripting 4 01-09-2009 08:45 PM
Linux Shell Question: how to print the shell script name ? meili100 UNIX for Dummies Questions & Answers 3 07-01-2008 01:55 PM
How to Start a Shell as Login shell instead of ordinary shell Sivaswami Linux 3 07-01-2008 01:52 PM
Difference between writing Unix Shell script and AIX Shell Scripts haroonec AIX 0 04-12-2006 02:27 AM
how to convert from korn shell to normal shell with this code? forevercalz Shell Programming and Scripting 21 11-23-2005 02:18 AM

View Poll Results: What's your most useful shell?
/bin/sh 61 8.62%
/bin/csh 34 4.80%
/bin/ksh 295 41.67%
/bin/tcsh 33 4.66%
/bin/bash 285 40.25%
Voters: 708. You may not vote on this poll

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 6 votes, 4.33 average. Display Modes
  #1 (permalink)  
Old 08-28-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
Quote:
Originally Posted by cfajohnson View Post

You can turn that on in bash with shopt -s extglob.
Hey cool! Thanks!
  #2 (permalink)  
Old 09-25-2008
sentinel sentinel is offline
Registered User
  
 

Join Date: Sep 2008
Location: OS X 10.5.5 /bin/bash 3.2.17
Posts: 26
I use and like bash.

However, strangely (I use several terminal windows), i have never figured out where the history of each window goes. I am certain that bash does not *save* command history per window. The .bash_history file has the history of which terminal window -- certainly not all.

That said I am still after 20 years of unix, not happy with the scripting language. Minor issues like spaces matter in variable setting, and various other places. Also, when reading lines frm a file in a loop, words get split -- you have to remember to change the setting for that.
Spaces in filenames cause annoying problems.
e.g.
Quote:
rm -rf `locate <somepattern>`
However, i love the history substitutions like:

Quote:
ls /some_loooong_path/somefile.c
vim !*
Has anyone heard of the shell: fish ?

Last edited by sentinel; 09-25-2008 at 01:08 AM..
  #3 (permalink)  
Old 09-25-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
Quote:
Originally Posted by sentinel View Post
I use and like bash.

However, strangely (I use several terminal windows), i have never figured out where the history of each window goes. I am certain that bash does not *save* command history per window. The .bash_history file has the history of which terminal window -- certainly not all.
Right, but you can set the history file dynamically, just by changing the environment variable HISTFILE, which is what I do with screen, etc. Then each terminal is in a separate one. You can also set up something so that all the histories are merged and sorted at the end.
  #4 (permalink)  
Old 09-25-2008
sentinel sentinel is offline
Registered User
  
 

Join Date: Sep 2008
Location: OS X 10.5.5 /bin/bash 3.2.17
Posts: 26
Thumbs up

Quote:
Originally Posted by otheus View Post
Right, but you can set the history file dynamically, just by changing the environment variable HISTFILE, which is what I do with screen, etc. Then each terminal is in a separate one. You can also set up something so that all the histories are merged and sorted at the end.
btw, I started using screen a few days back and i love it. Could you please give me the exact setting for HISTFILE you use, and how you merge the histories. Is it just a simple cronjob that does a "sort -u" monthly ?

I googled and found this:
Quote:
HISTFILE=/root/.sh_history.`basename $TTY`
However, my gripe is that it seems all my terminals are not getting saved in the single bash_history file.

If you can share any tips for screen (related to this) or just share your screenrc -- would be really grateful. I have read lots of great tutorials, btw.
  #5 (permalink)  
Old 12-17-2008
zzol zzol is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 10
zsh

I use only zsh and like it.
  #6 (permalink)  
Old 12-20-2008
techlinux techlinux is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 86
My preference is bash. But ksh is also good if bash is not available. ksh or and bourne may also be a little easier for newer users.
  #7 (permalink)  
Old 01-05-2009
indiana_tas indiana_tas is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 17
I have used bash the longest since it is standard on RHEL and Mac OS X. I like it because it is intuitive and behaves identically on all of the systems I have used it on. But recently I stepped into the AIX world where ksh is the default shell. I do like the vi command line editing, but I can also do that in bash (using 'set -o vi' as mentioned in this thread). I didn't know about the korn auto-completion options, so thanks to those who shared those tips! But one thing I really adore about bash and tcsh is that you can use time-saving history recall options, like:

Code:
$! - return last option to the previous command
!^ - return first option to the previous command
!:2-4 - return second through fourth options to previous command
!vi - recall last vi command
!?grep - recall last command that had grep anywhere in it
And if you're unsure whether you'd want to execute the command, use the print option with the history recall command to print the command first...

Code:
!?grep?:p
!vi:p
When you use the : p option as seen in the first example, you need the trailing "?", otherwise you can omit it.

Last edited by indiana_tas; 01-05-2009 at 12:12 PM..
Reply

Bookmarks

Tags
bash, ksh, linux commands, shell, shell script, shell scripting, unix commands, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0