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.
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)
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)
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)
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 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)
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)
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)
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)
#!/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)