New to korn shel1 and having an issue. The following is suppose to read the parameter values from files in a source directory and then pass them on to a log file in a different directory, The ArchiveTracker scripts is suppose to call the parameterreader script to exact the parameter values and pass them on to a log file.
But I keep getting the following when I run the script.
code
code
code
code
Last edited by Scrutinizer; 01-05-2016 at 01:59 PM..
Reason: code tags added
it is hard to tell anything without way more info. Where - in which line - does the error occur? You say you're running ksh, but the error is from bash. What is PARVALUE in the first script supposed to be? Where is file set? And, if you intended to set a shebang in the first line of both scripts, the correct syntax is #!/bin/ksh.
I have correct the portion identifying the script as ksh. But when should I include the PARVALUE variable within the first script. Script is running but always going to step portion of the script.
I assume that you meant for the code:
to set SourceLocation to the pathname of the current directory, but that is not what this code does. It sets SourceLocation to the literal string pwd.
Try this instead:
or one of the much slower options:
or (the less preferred form of command substitution):
Note the huge difference in behavior between backquote ` and single-quote '.
Then note that the code:
is setting sfile as the loop control variable and using file inside the loop. And, that the if test is looking at the size of $SourceLocation/$SourceLocation/filneame. Maybe you meant something more like:
If this still doesn't work turn on tracing so you can see what is happening as your script runs. You can run on tracing by invoking your script with:
or by adding the following line as the second line of your script:
Last edited by Don Cragun; 01-05-2016 at 07:07 PM..
Reason: Add note about another problem in the code.
#!/bin/awk -f
BEGIN {i=1;file="modified.txt"}
{
if ($0 !~ /^DS:/) {print $0 >> file} else {
if ($0 ~ /^DS:/) {print "DS: ",i >> file;if (i==8) {i=1} else {i++}};
}
}
END {gzip file}
Can someone explain to me how this above script works, I got it from a friend but not able... (3 Replies)
Hi,
I am trying to set ulimit for soft stack unlimited, but this is not taking effect, after tracing the ulimit -a unlimited command, the below output was generated, which i am unable to comprehend. Could any one help me with this?
prcbap1-r10prod: truss -d ulimit -s unlimited
Tue Dec 30... (2 Replies)
Hello world! Can someone please explain me how this code works? I'ts supposed to find words in a dictionary and show the anagrams of the words.
{
part = word2key($1)
data = $1
}
function word2key(word, a, i, x, result)
{
x = split(word, a, "")
asort(a)
... (1 Reply)
In my directory I have two files and one subdirectory. When I run
ls -l |grep -v ^d I get the following output:
total 8
-rwxrwxrwx 1 qms qms 254 Oct 3 16:00 file1.txt
-rwxrwxrwx 1 qms qms 7167 Oct 11 15:46 file2.txt
Can you explain what is total 8 if the number of files is 2 and is... (3 Replies)
I am hitting this command:
dvlna021-(/cm/ims/dev/gds-scheduler/10/app/Software/active/Soft/conf)->ls -lrt gds_userenv_*
This is the output
lrwxrwxrwx 1 aimse was 65 Jul 31 12:56 gds_userenv_scheduler_2.ksh -> /cm/ims/dev/gds-scheduler/10/app/conf/gds_userenv_scheduler_2.ksh ... (2 Replies)
I have taken putty session of a server from two separate machines namely HOST1(3 sessions) and HOST2(1 Session) .
However w command says there are 5 users
Confused over the output any clue will be appreciated.
# w
09:29:36 up 34 days, 15:48, 5 users, load average: 0.62, 4.33, 8.16
USER ... (3 Replies)
I m executing ps command and sorting it according to memory usage.
Please find the output of the command.
# ps aux --sort pmem
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2060 624 ? Ss 01:54 0:00 init
root 2 0.0... (1 Reply)
Hey forum,
I have a problem with a script what used to work, but suddenly is not working anymore. I have been trying different things for an hour now and I give up :D .
#!/bin/sh
asukoht=`pwd`
template=$1
for values in... (4 Replies)
root@desktop:~# last reboot | head -1
reboot system boot 2.6.31-17-generi Tue Jan 26 12:05 - 13:52 (01:46)
What does the last two fields(12:05 - 13:52 (01:46)) of the output mean? (2 Replies)