Hi! I'm somewhat new to Unix (I use it to fiddle, but not seriously), and at my work I have come to use it quite a bit. My question is this:
I want to create a script to take the tedium out of repetitious tasks. However, I need to pass a file name into the script in order for it to work.
... (5 Replies)
I'm trying to write a ksh script that uses awk, but I want to pass variables to awk. For example (not working):
if ];then
searchstr=$1
lsof -i | awk '{if($9~/SEARCHSTR/) print $2} SEARCHSTR=$searchstr'
else
echo "usage: $0 <search string>"
fi
I tried several options. Is it... (3 Replies)
I am trying to pass a regular expression variable from a simple script to sed
to remove entries from a text file
e.g.
a='aaaa bbbb cccc ...|...:'
then executing sed from the script
sed s'/"'$a"'//g <$FILE > $FILE"_"1
my output file is always the same as the input file !!
any... (5 Replies)
Hello all,
i have a infile.txt text file which contains such variables:
aaa 123
asds 1323
asdsd 13434
lkjlkj 324324
23432 lkjlkj
24324 ljlkj
3j4lk 234kj3
and i want to pass them to my script such as:
./myscript $1 $2
where $1 is the first value in the first row and $2 is the second... (2 Replies)
Hello ,
I have a script named testscript.sh
wherein I have two variables $var and $final (both of which contain a number)
I have a sed write function inside this script as follows:
sed '1,2 w somefile.txt' fromfile.txt
Now , in the above i want to pass $var and $final instead of... (2 Replies)
I'm writing a script to automate some post-install tasks on RHEL4 servers.
I need the following code to insert an 'A' in the middle of a string, then replace the string in a file. I know I can use sed to do this, but I'd like to use perl's in place edit so I don't have to write to a temp file,... (1 Reply)
Hello again,
You guys might remember me from the "Apache problems" thread. And because this forum is the only one that actually helped me out after months of problems I was hoping you could help me with something related.
Now if you remember the final code that we made for creating an account... (0 Replies)
How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ?
I've given portion of the script here to explain the problem.
Portion of Script 1
=============
-----
-----
tmp=`a.ksh p1 p2 p3`
if then
# error processing
fi
-----... (10 Replies)
Hi,
I need to pass a gnuplot value to a shell script. I have a main shell script (Main.sh) that has a bunch of gnuplot commands. Main.sh calls another gnuplot script (Child.gnu). A part of the code in Child.gnu is as follows:
sp '</data/src/scripts/results/plot_data.sh $col' u (A):2:3 w pm3d... (8 Replies)
Hi,
this is the example i'm trying to do.
script1.sh
ABC="test.txt"
./script2.sh "$ABC"
script2.sh
INPUT="$HOMEDIR/$ABC"
echo $INPUT
when i run the 1st script it gives me
../home/
the test.txt is not passed into 2nd script. How can i resolve this. (2 Replies)