Tag Info

Hot answers tagged

6

From http://www.manpagez.com/man/1/ksh/: <>word Open file word for reading and writing as standard out- put. <&digit The standard input is duplicated from file descriptor digit (see dup(2)). Similarly for the standard output using >&digit. <&- ...


5

You have to use a named pipe for that. First create one in the folder: mkfifo foo.pipe Then use that command: tar cvf foo.pipe ./foo >foo.out 2>foo.err & cat foo.pipe >foo.tar Notice: the cat-part, can now also be gzip or whatever, that can read from a pipe: tar cvf foo.pipe ./foo >foo.out 2>foo.err & gzip -c foo.pipe ...


5

If your system supports /dev/fd/n: tar cvf /dev/fd/3 ./foo 3>&1 > foo.out 2>foo.err | squish > foo.tar.S Which with AT&T implementations of ksh (or bash or zsh) you could write using process substitution: tar cvf >(squish > foo.tar.S) ./foo > foo.out 2>foo.err That's doing exactly the same thing except that this time, ...


4

ksh does not have pushd, popd as built-in. But it has an implementation for you. Try: . /usr/share/ksh/functions/pushd or: . /usr/share/ksh/functions/popd Then you can use pushd and popd. To make it permanent, you can source those files directly in your .kshrc or add them to FPATH environment variable.


3

You get an error because you're attempting to do arithmetic equality with string values. Here are 2 ways to check whether the elements of dfArray are in dsmArray set -A dfArray / /usr /var /tmp ... set -A dsmArray /home /opt /usr ... for a in "${dfArray[@]}"; do in=false for b in "${dsmArray[@]}"; do if [[ $a == $b ]]; then echo "$a is in ...


3

Appears so: $ command -v ksh /usr/bin/ksh $ what /usr/bin/ksh /usr/bin/ksh: Version M-11/16/88i SunOS 5.8 Generic 110662-24 Apr 2007 $ ksh $ x=08 $ y=$(( 10#$x - 1 )) $ echo "$x - $y" 08 - 7 From the "Arithmetic Evaluation" section of the man page: Constants are of the form [ base# ] n where base is a decimal number between ...


3

Running sqlplus from a crontab entry can be frustrating. You get a very sparse PATH variable as the shell that crond forks off does not read the "rc" file. In your ".profile" file do you set ORACLE_HOME? Do you include $ORACLE_HOME/bin in the PATH, and export ORACLE_HOME and PATH? Check that first. Also, I have to note that your code shows the ksh in ...


1

As you have all fields in first row of file you can use the following code: IFS='|' read -d ^ -a field < "$RUNTIME/EMAIL_$System`date +%y%m%d`.csv" Please note that ^ can be any symbol which surely should not meet in the text to operate it trough till the end. All necesary fields will be stored into array field starting from 0-element: field[0] , ...


1

While (given your input) it's not quite clear what you're trying to do in full the problem with the output is that only the last line fed into awk will ever be printed because of the fact that you put the print in the END statement. It should look like this: BEGIN { RS="\n\n"; FS=" "; } { print $1,$2,$3,$4,$5; } Note: the indentation is just my ...


1

Ctrl+D (ASCII EOT) already is mapped to exiting the shell, in both vi and emacs modes, as the ksh93 manual page explains. It's quite evidently so from your script capture. The manual page also explains what others have commented here, that this key only has this effect if the line is empty. (This mimics the standard behaviour of the line discipline in ...



Only top voted, non community-wiki answers of a minimum length are eligible