10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I need to split a file into two of different locations by re-direction in awk.
cat infle
aaa 1 3
bbb 2 4
aaa 3 3
bbb 4 4
aaa 5 3
bbb 6 4
cat /storage/tmp/group_a.gtf
aaa 1 3
aaa 3 3
aaa 5 3
cat /storage/tmp/group_b.gtf
bbb 2 4
bbb ... (2 Replies)
Discussion started by: yifangt
2 Replies
2. Shell Programming and Scripting
Hello
I have found some piece of code to verify and then run shell script with root permission from normal user.
see : http://blog.mecworks.com/articles/2006/02/23/bash-scripting-tip-running-a-script-as-root
I have wrote two scripts using this tips.
- one to copy file from server to local... (6 Replies)
Discussion started by: jcdole
6 Replies
3. Shell Programming and Scripting
Hello,
I have a problem with a bash script, I've been doing recherches but i can't make it work. It is my first time with a dynamic variable and i don't understand how to write it.
#!/bin/bash
USER=BARSPIN
HOTKEYS_PATH="/home/$USER/Documents/bash/tibia/HOTKEYS"
CFG1="A"
CFG2="B"... (5 Replies)
Discussion started by: barspin
5 Replies
4. Shell Programming and Scripting
I tried to parse data from switch configuration files
vlan 1727 name SQ5506-15 by port
tagged ethe 8/1 to 8/2
untagged ethe 1/13
!
vlan 2105 name SQ5620-7007(BR2) by port
tagged ethe 8/1 to 8/2
untagged ethe 1/17
!
interface ethernet 1/13
port-name SQ5506-15.nic0
rate-limit... (2 Replies)
Discussion started by: winggundamth
2 Replies
5. Shell Programming and Scripting
Hi,
I'm trying to populate bash script variable, data_size with the
size of the largest file in my current directory
data_size=$(ls -lS | grep -v "total" | head -1) | awk '{ print $5 }'
I've tried adding an echo before the call to awk
data_size=$(ls -l | grep -v "total" | head -1) |... (2 Replies)
Discussion started by: mark_s_g
2 Replies
6. Shell Programming and Scripting
I would like to create a variable within my bash script using awk. I'm reading in a line from an external file, then outputting to a new file in a specific format. But, it doesnt quite work as I have expected and could use some help.
(A pertinent excerpt of ) the bash code is:
count=1
... (4 Replies)
Discussion started by: snoitacilppa
4 Replies
7. Shell Programming and Scripting
greetings all,
I am have a heck of a time trying to accomplish a very simple thing. I have an array of "shortname<spaces>id" created from a dscl output. I want to assign shortname=word1 and id=word2. I have tried
shortname=$(${textArray} | awk '{print $1}') - and get 'awk : cannot open... (3 Replies)
Discussion started by: macnetdaemon
3 Replies
8. Shell Programming and Scripting
hi all i am trying to save an awk value into an array in bash:
total=`awk '{sum+=$3} END {print sum}' "$count".txt"`
((count++))
the above statement is in a while loop..
$count is to keep track of file numbers (1.txt,2.txt,3.txt,etc.)
i get the following error:
./lines1:... (1 Reply)
Discussion started by: npatwardhan
1 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have written a series of bash shell scripts that I will putting on a website for anyone (ie people in my specific field) to download and use. I am currently writing a readme file that explains how to run them, and it has occurred to me that it would be a good idea to indicate that they are... (1 Reply)
Discussion started by: msb65
1 Replies
10. Shell Programming and Scripting
I am extracting directory path from file which is stored in a variable.
while read inputline
do
script_name=`echo $inputline | cut -d' ' -f2`
cd $script_name
done < path_scripts.txt
where as path_scripts contains
input_process.bash ~/jobs/process/input/bin
The script output says... (1 Reply)
Discussion started by: jacksam007
1 Replies