10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I would like to iterate over `dirs`in a script, but the script will never show more than one (current) folder
#! /bin/bash
for i in `dirs`
do
echo ${i}
done
echo ++++++++++++++++++
for i in $( dirs -p )
do
echo ${i}
done
echo ------------------
dirscontent=`dirs`
echo... (5 Replies)
Discussion started by: alexanderb
5 Replies
2. UNIX for Beginners Questions & Answers
Have two 3 files which has list of servers,users and location and base url which is common on every server
A = server1 server2 server3
B = user1 user2 user3
C = dom1 dom2 dom3
baseurl=/opt/SP/
and what i have to achieve is below via ssh from REMOTE SERVER
for it's first iteration it... (7 Replies)
Discussion started by: abhaydas
7 Replies
3. Shell Programming and Scripting
I can not figure out how to iterate a perl command that inputs a value into columns and then combines them. I need to put a numerical value in column one and the word "Null" in all others, and then join at the end. I think the below is close, but I am not sure about the lines in bold. I... (7 Replies)
Discussion started by: cmccabe
7 Replies
4. Shell Programming and Scripting
I'm trying to send the file list as parameter to another job and execute it.
But the loop doesn't work, the inner job is running only once and not twice as expected
for filelist in $(ls -rt *.txt | tail -2)
do
echo $filelist
export filelist
cmd="$Program -config $configfile -autoexec... (11 Replies)
Discussion started by: asandy1234
11 Replies
5. UNIX for Dummies Questions & Answers
Hi guys,
I am having trouble with this script. What i want it to do is to iterate all command line arguments in reverse order. The code below does this fine but i need the output to print the words on separate lines instead of one line:
#!/bin/bash
#Takes in the arguments and displays them... (7 Replies)
Discussion started by: pipeline2012
7 Replies
6. Shell Programming and Scripting
Hi Experts,
I want to know the count of specific word in a file. I have almost 600+ files.
So I want to loop thru each file and get the count of the specific word.
Please help me on achieving this...
Many thanks (2 Replies)
Discussion started by: elamurugu
2 Replies
7. Shell Programming and Scripting
Hi,
I have a directory call Test, which contains files "a", b", "c", etc. I want to go through all of the files inside Test and remove any empty file. How would I do that with shell csh?
So far I got...
#!/bin/csh
if (($#argv == 0) || ($#argv > 1)) then
echo "no argument or too... (2 Replies)
Discussion started by: teiji
2 Replies
8. UNIX for Dummies Questions & Answers
I'm trying to iterate a UNIX awk script that returns min/max temperature data for each day from a monthly weather data file (01_weath.dat). The temperature data is held in $5. The temps are reported each minute so each day contains 1440 temperature enteries. The below code has gotten me as far as... (5 Replies)
Discussion started by: jgourley
5 Replies
9. Shell Programming and Scripting
I can not for the life of me figure out how to iterate over this array
{
'name1' => {
'a' => .
'b' =>
},
'name2' => {
'a' => .
'b' =>
}
}
I want a for loop to iterate through the first element (name1 and name2 in my example) but I can't figure it out. Help... (2 Replies)
Discussion started by: IMTheNachoMan
2 Replies
10. Shell Programming and Scripting
Greetings.
I'm having a time of it with this file. I'm trying to do a script that will take two command line inputs, string1 and string2 and use sed to change the text over files in the current directory. This is what I have so far. It appears to work a little, it does create the... (3 Replies)
Discussion started by: rdanda
3 Replies