Search Results

Search: Posts Made By: nobody4
3,054
Posted By nobody4
Simpler is better.
Indeed - I like this a lot.
This is an excellent approach if the files to be edited have a unique and easily found
insertion point and it is safe to stuff in the change.

Simpler is better.
Forum: Programming 04-09-2009
5,014
Posted By nobody4
Use the man pages, Luke. char...
Use the man pages, Luke.

char *strncat(char *restrict s1, const char *restrict s2, size_t n);

strcat(), strncat(), strlcat()
The strcat() function appends a copy of string s2,...
1,804
Posted By nobody4
{ print $1,$2,$3,$4,$5 ...
{
print $1,$2,$3,$4,$5
for(i=6;i<NF;++i)
printf "%s ", $i;
print $NF;
}
10,674
Posted By nobody4
You probably need to spec this a bit better. ...
You probably need to spec this a bit better.
It's not clear whether you need help with writing the "dojob.sh" script,
or with taking the subject line and using the information in it to invoke
the...
1,534
Posted By nobody4
It's a bit hard to tell without any of the...
It's a bit hard to tell without any of the debugging output that this would generate,
but there are a couple of small things to check:

You have this on the second line to create the output file...
6,932
Posted By nobody4
I think you need to tell people what aspects of a...
I think you need to tell people what aspects of a script you want to review...
and then of course you will have written your own answer.

It's not clear how anyone could do this for you.

Check...
1,198
Posted By nobody4
$ cat f5 this is a line with ${INSTHOME} in it....
$ cat f5
this is a line with ${INSTHOME} in it.
This is not.



$ $ sed 's/${INSTHOME}/a change /' f5
this is a line with a change in it.
This is not.
3,054
Posted By nobody4
How to insert a block of statements within a set of files
The smart answer is "no there is no easy way to do this. Edit the files yourself".

However, I took it as a challenge and came up with a solution, such as it is.
It will insert the new code...
1,897
Posted By nobody4
Getting the value of env variables
You need to evaluate the "name" variable before you can use it that way,
essentially give the shell a chance to process it as though it was typed in.

eval cd $name

Depending on how much you...
31,536
Posted By nobody4
You just didn't finish your command. Every "if"...
You just didn't finish your command.
Every "if" has to have a "fi"
That "mode" with the prompt ">" is telling you that you have not yet finished what you started.


service postgresql status; if...
2,290
Posted By nobody4
Parsing hddtemp input
I agree that awk is the tool for this.
It will handle changes in the length of disk names, etc.
better than some other approaches.

Assuming that more than one disk temp is on each input line, ...
1,949
Posted By nobody4
I can't say for sure what is wrong, but I can...
I can't say for sure what is wrong, but I can make a guess based on a suspicious construct in the script.

Given this
run_sqlplus "exec $SQL_PACK "
EOF

It seems possible to me that...
2,370
Posted By nobody4
Parsing an irregular CSV file
To skip (that is, preserve) the other lines, just print them,
making sure that you DON'T do this when you add an "X".


nawk -F, ' NF == 3 { print $0 "X" ; next } {print} ' inputfile
26,197
Posted By nobody4
Re: Piping STDOUT as pattern to grep or sed
egrep has (and some greps have) an option to read the patterns from a file.

If your OS (like Solaris) provides a mechanism to access
file descriptors as filenames, one can use this to read file...
1,847
Posted By nobody4
An English teacher should know better than to...
An English teacher should know better than to punctuate a shell script.
It makes the script fail. If that's not a problem in your original script, then you didn't get off as easily as I had hoped. ...
1,847
Posted By nobody4
Re: Why does this only read the one folder?
The only thing that I can see is the period after "done" which will generate an error and stop after the first folder.

Other than that, the code works fine on my Solaris system using sh and ksh ...
4,815
Posted By nobody4
We do need to see your code, but I'll take a...
We do need to see your code, but I'll take a guess anyway.
It seems likely that you need something like "eval" to evaluate the assignment.

variable=preset_value
read line
[user input is...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 06:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy