Sponsored Content
Operating Systems AIX Unable to save my configurationsettings Post 302253165 by bakunin on Friday 31st of October 2008 05:40:53 AM
Old 10-31-2008
Quote:
Originally Posted by nivaspIND
EDITOR=emacs # This is my fave editor
Hmm..., do NOT CONFUSE "EDITOR=" and "set -o", they are serving different purposes. If you want emacs-style commandline editing (for instance, "CTRL-P" for the previous command, "CTRL-N" for the next command, etc.) replace this line with "set -o emacs" or at least add this line to the file.

I suggest you read the man page about ksh or a good book about ksh to find out more about the many configuration options this shell has. One book i can recommend wholeheartedly is "The ksh Programming Tutorial" by Barry Rosenberg.

Quote:
alias c='clear'
Not sure, what you want to achieve here, but if you want a command to clear the screen use "tput clear". That "clear" works is by chance and it might not be this way on the next machine, but "tput clear" will works always. You might consider changing the line to "alias c='tput clear'".

Quote:
alias x='exit'
You do not have to type "exit" to leave the shell. A simple "CTRL-D" (which is a EOF character, actually) will also get you out of the shell.

To understand this consider the following: an interactive shell session is quite the same as a shell executing a script. The interactive shell is just "reading" your terminal as input file. If you present an EOF character you tell the shell that this "input file" is finished her - so the shell will stop and exit.

You can prevent this behavior (and this is sometimes done out of a false sense of security, because it adds nothing to the security of a system) by setting "set -o ignoreeof", which will cause the shell to ignore this EOF character. If your system is configured this way you can change the setting by "set +o ignoreeof".

Quote:
when I type
$ oslevel -r command - I get the result but with the screen cleared
but when I use with sudo , I have no issues
$ sudo oslevel -r ....... i get the result at the next line......
Issue the "alias" command to list all aliases in effect. maybe the oslevel command is not what it should be.

Alternatively use "which oslevel" to find out if there is some script named oslevel before the binary in the path. The "$PATH" variable is searched consecutively and if it looks like "/usr/local/bin:/usr/bin:..." and in /usr/local/bin is an executable file named the same way as one in /usr/bin you would use the one from /usr/local/bin and not from /usr/bin. The "which" command tells you which one it will load effectively.

If something like this is the case either "unalias" the offending alias or Reaarrange the $PATH variable. by simply setting it anew: "PATH=/first/dir:/second/dir:....". You could put this also in your .kshrc.

I hope this helps.

bakunin
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

save me!

Hi! can anyone tell me how to save a file from command line? Any help appreciated. (2 Replies)
Discussion started by: hufs375
2 Replies

2. Programming

cannot save file...

Hello! I have a problem: I compile some function, which must save file: ===================== // prog.cpp void save_file(){ FILE *fs = fopen("file.txt", "w"); if(!fs) cerr<< "cannot save"; fprintf(fs, "This is a text file."); fclose(fs) } ===================== If i compile it from... (8 Replies)
Discussion started by: szzz
8 Replies

3. UNIX for Dummies Questions & Answers

how to save files?

i just typed out a letter but want to hang on to it i typed it out in vi and was wondering how to save and exit from it? also how do you S&E from emacs since those are the two editors i mainly use any help would be appreciated (2 Replies)
Discussion started by: hiei
2 Replies

4. Shell Programming and Scripting

save

hi i would like someone to assist me to find out how i can Write a script called save which copies a file into a special directory, and another called recover which copies a file back out of the special directory. The user of the script should not be aware of the location of the special directory... (2 Replies)
Discussion started by: swainaina
2 Replies

5. UNIX for Dummies Questions & Answers

can't save crontab with vi

I edit crontab with vi editor, i delete the lines i wanted, but i can't save! i tried the :w, :wq, ZZ commands and it seems like vi is unfamiliar with it. any suggestions? (3 Replies)
Discussion started by: idan_cn
3 Replies

6. UNIX for Advanced & Expert Users

Can't save a file

There is a file A.lcf. I am updating the file and saving it . But as soon as I am logging off and then logging in I am finding that the updated changes are not there in the file. (5 Replies)
Discussion started by: suchismitasuchi
5 Replies

7. Shell Programming and Scripting

Save cURL verbose output to file or do it like browser "save as.."

hi there ! i have exactly the same problem like this guy here https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html i am not able to save the curl verbose output.. the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies

8. UNIX for Dummies Questions & Answers

how to save changes to a file

is i want to sort or delete lines etc etc to a file, how do i save the changes. example i do sort file > file when i do cat file, all data is erased. thanks. (2 Replies)
Discussion started by: hobiwhenuknowme
2 Replies

9. Shell Programming and Scripting

Save value from output of Corestat and save in a list for each core

I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below: Core Utilization CoreId %Usr %Sys %Total ------ ----- ----- ------ 5 4.91 0.01 4.92 6 0.06 ... (0 Replies)
Discussion started by: Zam_1234
0 Replies
clear(1)						      General Commands Manual							  clear(1)

NAME
clear - clear the terminal screen SYNOPSIS
clear [-Ttype] [-V] [-x] DESCRIPTION
clear clears your screen if this is possible, including its scrollback buffer (if the extended "E3" capability is defined). clear looks in the environment for the terminal type given by the environment variable TERM, and then in the terminfo database to determine how to clear the screen. clear writes to the standard output. You can redirect the standard output to a file (which prevents clear from actually clearing the screen), and later cat the file to the screen, clearing it at that point. OPTIONS
-T type indicates the type of terminal. Normally this option is unnecessary, because the default is taken from the environment variable TERM. If -T is specified, then the shell variables LINES and COLUMNS will also be ignored. -V reports the version of ncurses which was used in this program, and exits. The options are as follows: -x do not attempt to clear the terminal's scrollback buffer using the extended "E3" capability. HISTORY
A clear command appeared in 2.79BSD dated February 24, 1979. Later that was provided in Unix 8th edition (1985). AT&T adapted a different BSD program (tset) to make a new command (tput), and used this to replace the clear command with a shell script which calls tput clear, e.g., /usr/bin/tput ${1:+-T$1} clear 2> /dev/null exit In 1989, when Keith Bostic revised the BSD tput command to make it similar to the AT&T tput, he added a shell script for the clear command: exec tput clear The remainder of the script in each case is a copyright notice. The ncurses clear command began in 1995 by adapting the original BSD clear command (with terminfo, of course). The E3 extension came later: o In June 1999, xterm provided an extension to the standard control sequence for clearing the screen. Rather than clearing just the vis- ible part of the screen using printf '33[2J' one could clear the scrollback using printf '33[3J' This is documented in XTerm Control Sequences as a feature originating with xterm. o A few other terminal developers adopted the feature, e.g., PuTTY in 2006. o In April 2011, a Red Hat developer submitted a patch to the Linux kernel, modifying its console driver to do the same thing. The Linux change, part of the 3.0 release, did not mention xterm, although it was cited in the Red Hat bug report (#683733) which led to the change. o Again, a few other terminal developers adopted the feature. But the next relevant step was a change to the clear program in 2013 to incorporate this extension. o In 2013, the E3 extension was overlooked in tput with the "clear" parameter. That was addressed in 2016 by reorganizing tput to share its logic with clear and tset. PORTABILITY
Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7 (POSIX.1-2008) nor X/Open Curses Issue 7 documents tset or reset. The latter documents tput, which could be used to replace this utility either via a shell script or by an alias (such as a symbolic link) to run tput as clear. SEE ALSO
tput(1), terminfo(5) This describes ncurses version 6.1 (patch 20180127). clear(1)
All times are GMT -4. The time now is 08:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy