I am running this script in AIX (tried SH, KSH). I would like to pass in a comma deliminted list and have the script parse the list. I ran this same script in an HPUX environment and it works perfectly. I thought if I used the same shell it wouldnt matter what flavor of Unix it was on (obviously...
All,
I have an input file:
$cat t.txt
A B C D
$cat t.sh
while read line
do
echo $line
done < t.txt
$./t.sh
A B C D
My question is: How do I "keep" the spaces? I would like the variable to hold the entire formatted line of the input file ("A B C D"). I know I can...
Hello,
I have an xml file all on one line. I would like to separate all tags on separte lines. I am having problems creating the proper regex to grab the shortest pattern. Here is my example file:
<a>who cares</a><b>not me</b>
my script:
gsub(/<\/(.*)?>/, "n")
outfile:
<a>who caresn...
I have an issue with an awk script I am stumped on and am looking for some assistance. Here is an example of an input file:
5019970714 W 4 0000000132
5019970721 W 4 0000000000
5020040201 20040315 F 4 0000001291
When $3 ==...
Hi,
I have a macro that is importing data, what I would like to do is import data from a path specified in a form rather than having it hard coded into the macro. Is there a way to do this.
Thanks
Hello,
I have two tables, and would like to delete records out of the second table if they are found in the first based on a key of three fields. Take the following example the first threee columns make up the key of each table:
Table 1 Table 2
1 1 1 3 1...
I would like to spin through a directory and process files older than 1 day old is there a better way to do this other than using the find command.
JesCat
I would like to spawn a new process to run concurrently with the calling process within a script. If I simply call the process to run the parent process sleeps while the child process runs. However I would like them to run concurrently. Is there a way to do this.
Any assistance would be...
I am tring to create a script with a dynamic regex however awk doesn't seem to like comparing a variable to a regex stored in a variable. For example:
regex = "/^abc/"
if ( $0 ~ regex ) {
print 1
} else {
print 0
}
Whether or not the if condition is true or not the script...
Is there a way in unix scripting to test variable using regular expressions similarly to awk or sed
For example:
awk:
$1 ~ /^[A-z].*$/ print "found regular expression"
Can you incorporate regular expression metacharaters in unix scripts
I have a question of how to replace a string at a static starting position and length with another string. For example in the following example of text how would I replace "hello" with five spaces.
12hello89
Note hello will always start in position 3 with length 5.
I can get sub or...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.