10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I have a below syntax its working fine...
var12=$(ps -ef | grep apache | awk '{print $2,$4}')
Im getting expected output as below:
printf "%b\n" "${VAR12}"
dell 123
dell 456
dell 457
Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
2. Shell Programming and Scripting
hi,
i am writing a shell script in which i read a line in a variable.
FNAME="s1.txt s2.txt s3.txt s4.txt s5.txt"
i want to create a array and store single file names in a array..
so the array should contain
arr="s1.txt"
arr="s2.txt"
arr="s3.txt"
arr="s4.txt"
arr="s5.txt"
how to... (3 Replies)
Discussion started by: Little
3 Replies
3. Shell Programming and Scripting
I know this is sort of trivial, but basically I want to store a directory as a variable in KSH so I can later call it.
I am not sure if the syntax is right:
DIRECTORY={/abc/domain/${DIV}/}
where DIV is another variable.
Thanks! (1 Reply)
Discussion started by: MIA651
1 Replies
4. Shell Programming and Scripting
Hello,
Following my learning of shell scripting.. I got stuck yet again.
If I execute this command on terminal:
$ sed "s/off/on/g" file > fileAUX
I successfully change the text off to on from file to fileAUX.
But the same command is not working inside a shell script. I tested and... (2 Replies)
Discussion started by: quinestor
2 Replies
5. Shell Programming and Scripting
Hello everyone,
I have a RHEL 5 system and have been trying to get a batch of 3-4 scripts each in a separate variables and they are not working as expected.
I tried using following syntax which I saw a lot of people on this site use and should really work, though for some reason it doesn't... (3 Replies)
Discussion started by: rockf1bull
3 Replies
6. Shell Programming and Scripting
Hi,
I am trying to write a PBS shell script that launches a bash process. The issue is that the bash process needs a variable in it and the shell script is interpreting the variable. How do I pass this as a literal string? Here is my code snippit:
TMP=".fasta"
FILEOUT=$FILE$TMP
cd... (2 Replies)
Discussion started by: bioBob
2 Replies
7. Shell Programming and Scripting
Hi,
I'm trying to check if methods specified in a class have been added to the corrosponding interface.
My code below is giving me the following errors:
grep: function: No such file or directory
grep: import($zipfile): No such file or directory
grep: function: No such file or... (1 Reply)
Discussion started by: racshot65
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am writing a shell script where,
x=y
y=z
When I want to print z, I can do
$y
How do I use only "x" without any direct reference to "y" to print z?
Thanks,
-G (3 Replies)
Discussion started by: gaurab
3 Replies
9. UNIX for Dummies Questions & Answers
I'm sure this is a simple thing but I can't figure it out. In a script that I'm writing, I'd like to be able to store each line of output from "ls -l" into a variable. Ultimately I'd like to end up with something like:
for a in `ls -l`
do something with $a
doneBut that's reading each... (2 Replies)
Discussion started by: ewoods
2 Replies
10. Shell Programming and Scripting
Hi Frdz
while read line
do
name=`echo $line | cut -d' ' -f 1 `
password=`echo $line | cut -d`-` -f 2`
name > logfile.txt
password > logfile.txt
done < list.txt
When it is run, am getting last values in list.txt file only,it is not storing lall the list entry values. How can i... (5 Replies)
Discussion started by: KiranKumarKarre
5 Replies