10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i am a beginner i m learning shell by myself
i have problem writing a korn shell that takes an absolute pathname to directory and display all ordinary files in the directory ordered by their length.
i was thinking use grep ls sort and sed. maybe, i m wrong! can someone tell me? (2 Replies)
Discussion started by: babuda0059
2 Replies
2. Shell Programming and Scripting
Using the KSH, write a shell script called display_by_length, which takes an absolute pathname to a directory and displays all ordinary files in the directory ordered by their length; for each file listed, display the name of the file and its length - nothing else. Extend this script to take an... (1 Reply)
Discussion started by: babuda0059
1 Replies
3. Shell Programming and Scripting
Write a function called dateToDays that takes three parameters -a month string such as Sep, a day number such as 18, and a year number such as 1962-and return s the number of days from January 1, 1900, to the date.
Notes: I am asking you to account for leap years.
my script is not... (0 Replies)
Discussion started by: babuda0059
0 Replies
4. Shell Programming and Scripting
can someone look into this one please... I am struck at this point. I do not know what logic to be followed here. I can go ahead with my work only, if this step is done. Please Help.
I have a process X in a shell script. Once the process X is done, it generates a log file. Process X is basically... (1 Reply)
Discussion started by: ss3944
1 Replies
5. Shell Programming and Scripting
Hi All,
Consider my script is getting input from user under utc/stb path. I should automate the script by reading inputs from .txt file. Whenever script is prompting for input, it should read from input file. Now, i have to create a script in different path that should run my old script by... (4 Replies)
Discussion started by: poons
4 Replies
6. Shell Programming and Scripting
In a Korn shell script I have,
cat ../header | sed -e 's/flag1/$cnumb/g' > header.txt
The header is short
{{Company flag1}}
But the result in header.txt is
{{Company $cnumb}}
The value of $cnumb is 120. I am trying to get the value of $cnumb into the header.
I have tried /'$cnumb'/g,... (10 Replies)
Discussion started by: jcarrott
10 Replies
7. Shell Programming and Scripting
Hi guys,
I'm trying to write a small script that sets up RAID using MDADM without asking user for any input.
Here's what I'm doing:
start=`mdadm --create $2 --level=$3 --raid-devices=$4 $5 $6 << MAYDAY
y
MAYDAY`
When I it, I get this
./redundancy -setup /dev/md0 1 2 /dev/files/test0... (3 Replies)
Discussion started by: alirezan
3 Replies
8. Shell Programming and Scripting
My Korn shell script below is giving me the following error: ./test.ksh: 0403-057 syntax error at line 7 : 'then' is not matched.
Can anyone provide a quick solution as to why the error is occurring? Thanks.
#!/usr/bin/ksh
typeset -i RecCount
typeset -i RecCount2
RecCount=`db2 -x "select... (23 Replies)
Discussion started by: sasaliasim
23 Replies
9. UNIX for Dummies Questions & Answers
hi all, I have read similiar topics in this board, but i didn' t find the posting which is the same with the problem i face.. I try to extract string from the end. i try to do this:
num=abcdefghij
num2=${num:-5}
echo $num2 #this should print the last 5 characters (fghij)
but it doesn;t... (3 Replies)
Discussion started by: nashrul
3 Replies
10. Shell Programming and Scripting
I have to copy an array to a temp variable and back after doing some functions. I am trying to see if it is possible to do without while loops.My closest try was
set -A temp ${THE_ARRAY}
# restore array after some actions
set -A THE_ARRAY ${temp}
The problem with above is that, the new... (1 Reply)
Discussion started by: vijay1985
1 Replies
IMEDIFF2(1) IMEDIFF2(1)
NAME
imediff2 - An interactive fullscreen 2-way merge tool
SYNOPSIS
imediff2 [-m] [-u] [-a] [-b] [-c] [-N new-file] [-o outputfile] {file1} {file2}
DESCRIPTION
Merge two (slightly different) files interactively with a user friendly fullscreen interface in text mode.
Imediff2 shows the differences of given two files (in color if the terminal supports them), lets you scroll the file and toggle changes be-
tween old and new version one by one. If the 'unresolved' mode is enabled, you can optionally save both versions.
Additionally, if the $EDITOR environment variable is set or if /usr/bin/editor exists and is executable, you can also launch an external
editor and manually edit the half-merged file before saving it, perhaps to resolve the 'unresolved' parts.
Empty lines are shown in reverse colors so you see that you can select them. If a line is missing completely from one file, imediff2 dis-
plays it as a reversed '?'. While it seems to take one line in the editing phase, it is naturally not saved into the output file.
To see a list of keyboard commands, hit h or ? in the editor.
The program exits with status 0 if the changes were saved, 1 if the merging was aborted and 2 if the parameters were invalid.
OPTIONS
-o outputfile, --output=outputfile
Write output to given file. If missing, changes will not be saved.
-N, --new-file
Treat absent files as empty.
-m, --mono
Force monochrome display.
-u, --unresolved
Enable 'unresolved' mode (see above).
-a Start with version A (default).
-b Start with version B.
-c Start with unresolved changes (implies -u).
-h, --help
Show summary of options and exit.
-V, --version
Show version and exit.
KEYBOARD COMMANDS
The following keyboard commands are available in the editor.
h, ? Show commands.
up, down, left, right
Move in document.
page up, page down
Move a screenfull.
enter Toggle selected change.
n, tab, space
Jump to next change.
p Jump to previous change.
a Set current chunk to version A.
b Set current chunk to version B.
u Set current chunk to unresolved.
shift+a
Set all changes to version A.
shift+b
Set all changes to version B.
shift+u
Set all changes to unresolved.
e Launch external editor.
r Discard editor-made changes. (Available only after e.)
x, s Save and exit.
q, ctrl+c
Exit without saving.
home, end
Jump to start or end.
SEE ALSO
sdiff (1), diff (1), merge (1), diff3 (1).
COPYRIGHT
This manual page as well as the program itself was written by Jarno Elonen (<elonen@iki.fi>). Unlike the program itself, which is licensed
under the GNU General Public License (GPL) version 2 (or any later version, at your option), this document has been placed into the Public
Domain.
AUTHOR
Jarno Elonen.
2006-03-10 IMEDIFF2(1)