Hello,
I am trying to create a shell script that use command block (donīt really know if this is the correct way to say it), but while one version works fine, the other one is not working at all.
So let me show an example of this "command block" Iīm using and its working ok:
This next one is not working:
This is the error output:
If you compare the two codes you will notice that while the first code has only one command ( grep ), the second has two ( echo first, and then awk ), so Iīm guessing that is the problem... which is strange because if I use the `caracters` it is supose to accecpt it like a command. I have others scripts that use this.
So if you could give me a hint on how to solve this, I would be very gratefull. I'm kind on a hurry, since I making a series of script to run automatically during my well earned vacations.... (about to go crazy with all this work!)
You try to nest backticks ` ` into another. Problem is, that the line is not completely parsed so the 1st starting backtick is ended by the second, not the 4th.
I'd just write a normal shell script. HERE-Skripts that you feed with input are usually used for ftp scripts etc. Using this method in this particular case I see no benefit.
Also this can be written much more compact supposedly with 1 awk script for example. You can echo stuff with awk's print and printf as you already do and wc can be done by awk too. grep'ing of course can be done by awk too.
Hi there zaxxon
I know it is a mess (big time!), but this is just one part of the script and I chose to use command blocks because its server me better (I think) this way, because the output format is important since it will be used for treatment later on in the script.
So if it is possible, do you know of any way to nest the backtick in a correct form so it will not end with the first one but the last one?
Meanwhile I will try to follow your suggestion by rewriting the script without the blocks.
Thank you for your fast replay!
if you use the $( .. ) syntax in place you'll then be able to nest them.
Hi there,
In place where? I tried (in different positions) already but it seems to ignore the $(...) syntax altogether and produce a similar error output:
Frans,
It worked perfectly! I thought that only backtick (`) should be used in this type of command build, but $(..) syntax is good also, perfect for this situation.
So Frans and Zaxxon thank you very much for you help and time.
Hi,
I have Solaris-10 OS on T5220. Both local disks were mirrored under SVM. Somehow when one disk gone bad (c0t1d0), other disk (c0t0d0) also got lot of bad block. We have readable data only on c0t0d0, but as soon as server comes after, it hangs when I run few commands because of read errors,... (1 Reply)
Just began to learn on Shell Script. I got an exercise from my friend. I know how to make this happen in C, but I'm not familiar with Shell Script. Hope I can get some help from all of you.
I want to write a bash script to comment code blocks in a bash source file. What I mean comment is '#', I... (1 Reply)
please help, I have a huge file with blocks of data which I need to convert to a tabular format.
Input
sample
id: GO:0000017
name: alpha-glucoside transport
namespace: biological_process
def: "The directed movement of alpha-glucosides into, out of or within a cell, or between... (3 Replies)
Hello,
Searched for a while and found some "line-to-column" script. My case is similar but with multiple fields each row:
S02 Length Per
S02 7043 3.864
S02 54477 29.89
S02 104841 57.52
S03 Length Per
S03 1150 0.835
S03 1321 0.96
S03 ... (9 Replies)
Hi everyone,
I have a data.xml file which only contains thousands of data (tag) blocks. A part of the file looks exactly like this;
<data>
Line
Line
Line
</data>
<data>
Line
Line
Line
</data>
the rest of the file is simply a repetition of this part. Here each data block contains a... (8 Replies)
Hi
It happens when I try to delete a file of 250MB with the command rm -r on our old Intergraph CLIX that the filename disappears while the blocks remain on the machine. Only when I reboot the system the blocks really disappear. Then rm works again for sometime but after some time it happens... (15 Replies)
Hello,
I have a file like this:
FILE.TXT:
(define argc :: int)
(assert ( > argc 1))
(assert ( = argc 1))
<check>
#
(define c :: float)
(assert ( > c 0))
(assert ( = c 0))
<check>
#
now, i want to separate each block('#' is the delimeter), make them separate files, and then send them as... (5 Replies)
I'm Unix. I'm looking at "df" on Unix now and below is an example. It's lists the filesystems out in 512-blocks, I need this in 4k blocks. Is there a way to do this in Unix or do I manually convert and how?
So for container 1 there is 7,340,032 in size in 512-blocks. What would the 4k block be... (2 Replies)
Is it possible to use the ls command and NOT see the total blocks? For example, instead of seeing this...
$ ls -l
total 16
drwxr-xr-x 2 voicem voicem 4096 Dec 3 09:19 directory1
drwxr-xr-x 2 voicem voicem 4096 Dec 1 01:29 directory2
drwxr-xr-x 2 voicem voicem 4096 Dec 2 00:47 directory3... (5 Replies)