#!/bin/ksh
VAR_ONE=HELLO
TEMP=ONE
echo $VAR_${TEMP}
## Output is: ONE
Hi, I want the output to echo HELLO and not ONE as the above script does. I know I am missing something with dollar substitution. Can anyone help me out ?
Thanks.
Cal (4 Replies)
hello all
just trying to write a script that will read a file (line by line) and substitute (tht line) in a different file if (tht line) is present in second file
Ex: script has to read file A (line by line) and if file B has tht line it should get substituted with the line in file A
... (3 Replies)
Hi ,
I have have file which has following structure
01aaaa88888000-9999
01ssss77777000-0991
01ssss7777700000991
02ssss7777700000991
The record 01 is corrupt as value from 12th field to 19th should be positive or start with - however it is 000-9999 it should be -0009999
i need to... (4 Replies)
Hi, i want to change a subs. value in a file, with using a script..
this is my script... (example)
#!/bin/bash
NDIR=`zenity --file-selection --directory`
mv $HOME/Desktop/myfile /tmp/myfile.temp
XT='"'
perl -pe "s/.*/DIR=$XT`echo -e "$NDIR"`$XT/ if $. == 40" <... (2 Replies)
Hello everyone ...
I'm going crazy, I hope some of you can help me ...
I have to replace a line in a crontab like this:
5 2 * * 2 root backupdat
with this:
5 5 * * 3 root backupdat
the command I use is the following:
sed -i.bak -e 's/5 2 * * 2 root backupdat/5 5 * * 3 root... (4 Replies)
Hi all
Having issue with substitution using sed
Trying to assign the absolute path of the file to the variable 'floc' returned by the find command
floc=`find / -name $fname`
eg cat $floc '/root/samplecheck/myfile'
I want to replace '/' with '->' in the 'floc' i am using the below sed... (2 Replies)
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Hi,
I'm trying to reformat some badly formatted XML that I've extracted from Oracle clob columns using the following nawk command:
nawk '{gsub(/</,/>\n/); print}' test.raw > test.xml
the substitution executes fine, but instead of subbing < with > followed by newline, it subs the < with a... (3 Replies)
I have a huge script which is defining variables with full path of commands in the beginning of code and using those variables in the script.
For Example:
ECHO=/bin/echo
LS=/bin/ls
SED=/bin/sed
AWK=/bin/awk
UNAME=/bin/uname
PS=/bin/ps
DATE=/bin/date
GREP=/bin/grep
$ECHO "hello... (1 Reply)
Hi,
I have a script in which the file name is always known, but the extension could vary. I want to be able to use a single variable; no if-else statements. For example, if I have config.txt in the directory then that's what I want to use, but if config.xml is in the directory then use that. The... (9 Replies)
Discussion started by: ocbit
9 Replies
LEARN ABOUT ULTRIX
chfn
chfn(1) General Commands Manual chfn(1)Name
chfn - change system finger entry
Syntax
chfn [ loginname ]
Description
The command is used to change information about users. This information is used by the program, among others. It consists of the user's
real name, office room number, office phone number, and home phone number. The command prompts the user for each field. Included in the
prompt is a default value, which is enclosed between brackets. The default value is accepted simply by typing <CR>. To enter a blank
field, type the word `none'. This is an example:
% chfn
Changing finger information for doe
Name [John Doe]:
Office number [ABC-1/K0]: DEF-2/K1
Office Phone []: 1863
Home Phone [5771546]: none
The command allows phone numbers to be entered with or without hyphens. No entries may contain colons, commas, or control characters.
It is a good idea to run after running to make sure everything is the way you want it.
The optional argument loginname is used to change another person's finger information. This can only be done by the superuser.
Restrictions
The encoding of the office and extension information is installation dependent.
Because two users may try to write the file at once, a synchronization method was developed. On rare occasions, a message that the pass-
word file is "busy" will be printed. In this case, sleeps for a while and then tries to write to the file again.
If the passwd entry is distributed from another host will not modify it.
See Also
chsh(1), finger(1), passwd(1), passwd(5yp)chfn(1)