10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello all,
i have a code in which when doing a for loop, i need to direct the output to two files, one just a single output, the other to always append (historical reasons).
So far i managed to do the following, which is working, but am still considering it as "dirty".
... (4 Replies)
Discussion started by: nms
4 Replies
2. Shell Programming and Scripting
Hi,
I am working on Sun Solaris 5.10 and want to direct the output from a disk space check script to an output file;
#!/bin/bash
CURRENT=$(df -k /log/logs | grep /log/logs | awk '{ print $5}' | sed 's/%//g')
THRESHOLD=30
if ; then
echo "Remaining free space is low" > output.txt
else... (10 Replies)
Discussion started by: SSKAAB
10 Replies
3. UNIX for Dummies Questions & Answers
Hi, i'm trying to gather details from remote hosts and want them to be written to my local linux machine from where i'm using SSH. My command looks some thing like this
ssh -q remotehost 'bash -s' <command.txt
where command.txt is a file in my local machine containing
ps -ef |grep httpd |... (1 Reply)
Discussion started by: poga
1 Replies
4. Shell Programming and Scripting
Hi guys,
been scratching round the forums and my mountain of resources.
Maybe I havn't read deep enough
My question is not how sed edits a stream and outputs it to a file, rather something like this below:
I have a .txt with some text in it :rolleyes:
abc:123:xyz
123:abc:987... (7 Replies)
Discussion started by: the0nion
7 Replies
5. Shell Programming and Scripting
Greetings.
I have a nice bash shell script that runs a multi-step analysis well. I already have the SGE options set up to email me the progress of the run (started, completed, aborted), but a final step would be to code the shell script to email the final output (a .txt file) to the same email... (6 Replies)
Discussion started by: Twinklefingers
6 Replies
6. Shell Programming and Scripting
:wall::wall::wall:
Hi I have horrible script below, need help in renaming ls -l output into new filename format:
Desired output:
cp -pv original_path/.* newDirectory/owner_of_file.%dd%mm%y.file_extension.first_8_characters_of_original_filename
localuser@localuser:~ vi... (3 Replies)
Discussion started by: wolf@=NK
3 Replies
7. UNIX for Dummies Questions & Answers
How do i tell my bash shell script to test the output of the command i'm using?? I want this script to look for lines not equal to 1 then let me know..
$ cat blah ; echo ---- ; cat blah.sh
1 fe
1 fi
1 fo
0 fum
1 blahda
1 blah
0 blahh
1 bla
1 bl
1 blahhh
----
#!/bin/bash
while... (1 Reply)
Discussion started by: phpfreak
1 Replies
8. Shell Programming and Scripting
Hi,
I have a script to compare 2 files.
file1=$1
file2=$2
num_of_records_file1=`awk ' END { print NR } ' $file1`
num_of_records_file2=`awk ' END { print NR } ' $file2`
i=1
while
do
sed -n "$i"p $file1 > file1_temp
sed -n "$i"p $file2 > file2_temp
diff file1_temp... (5 Replies)
Discussion started by: autosys_nm
5 Replies
9. UNIX for Dummies Questions & Answers
Ok so i have this script and I dont know how to have the output go to a file and then email that file to someone.
#!/bin/ksh
print "AL"
print "AM"
print "AN"
print "RL\n"
nawk '/PROD/ {print $3, $2}' /home/user/switch_listtest | sort -k1,2
print "End of Report"
Thank you in... (2 Replies)
Discussion started by: llsmr777
2 Replies
10. Shell Programming and Scripting
Have a script that scp's tar file to multiple other servers in a for loop. Need to set monitoring and notification on it for when it fails.
Running this line of code in a 'for' loop...
scp $SOURCE_RECOVERY_TARFILE ${HOST}:${CURR_RECOV_TARFILE} 2>&1 | tee ${MONFILE}
Their are two outputs... (7 Replies)
Discussion started by: nmikes
7 Replies