10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In the else of the main if condition .
else
set lnk = $(readlink -f <path> | cut -d '/' -f7)
echo "$lnk"
if ]
When I run the above on command line , the execution seems to be fine and I get the desired output. But when I try to assign it to a variable within a loop... (12 Replies)
Discussion started by: sankasu
12 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. Shell Programming and Scripting
I'm trying to echo the release version of some of our Linux servers. Typically I do these types of things by "catting" a text file with the host names, "ssh-ing" to the host and running my string.
This is what I've written
for i in `cat versions.txt` ; do echo $i ; ssh $i cat /etc/issue |... (5 Replies)
Discussion started by: lombardi4851
5 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
: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
6. Shell Programming and Scripting
Hi,
Sorry I'm new to shell scripting..
my loop is as follows:
let i=0
for item in ${APPSARRAY}
do
#..some code to get a unique value called $result
let i=i+1
done
What I want to do is within the for loop, create a comma seperated list:
... (3 Replies)
Discussion started by: mjwoodford
3 Replies
7. Shell Programming and Scripting
I can run this from the command line:
scp -i identfile /path/file_to_send remotelogin@remotebox:/path_to_put_it/file_to_send
and I get:
file_to_send 100% |***************************************************************************| 0 00:00
but if I do:
scp -i identfile... (6 Replies)
Discussion started by: NewSolarisAdmin
6 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
Is there any way to combine the following two statements into one? I can't figure out how to get expr to take input from the output of the awk call - I've tried piping the output of the awk call into the expr call, and tried using a 'Here' document, nothing seems to work.
export CNT=`wc -l... (4 Replies)
Discussion started by: jvander
4 Replies