10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a issue.sh script
more issue.sh
#!/bin/bash -e
echo "start"
source ~/.moht
echo "end"
Contents of ~/.moht are as below
more ~/.moht
umask 022
export EDITOR=vi
SYSNM=`uname -n`
UID=`id`
HOST=`hostname`
Executing of issue.sh throws the below error (1 Reply)
Discussion started by: mohtashims
1 Replies
2. UNIX for Dummies Questions & Answers
I have 2 scripts first script would call second script.
test1.sh
#!/bin/bash
logfile=`basename $0`.log
echo "First File" >> $logfile
TIME=`ls -lu array.ksh | awk '{print $6" "$7" "$8}'`
. /home/infrmtca/bin/Test/test2.sh
#/home/infrmtca/bin/Test/test2.sh
test2.sh
#!/bin/bash... (1 Reply)
Discussion started by: Ariean
1 Replies
3. Shell Programming and Scripting
Hey everyone!
I have my .bash_profile file which is read automatically when I launch Terminal therefore I can run my own functions.
BUT.
When I do:
sudo -s
sudo su
sudo su -
No matter what I do, I can't get the .bash_profile file to be sourced automatically so I end up having to run... (2 Replies)
Discussion started by: dasx
2 Replies
4. Red Hat
Hi,
Im trying to run script A which requires path /sbin.
I have a crontab entry to run script A every 10 minutes.
Script A is executed fine by cron, but because script A requires /sbin in its path it fails to run.
My situation is script A get overwritten from time to time so I can't modify... (4 Replies)
Discussion started by: wilsonee
4 Replies
5. Shell Programming and Scripting
Problem in simple script form:
File 1:
# cat test.sh
#!/bin/sh
echo "Running test.sh - \$0 is $0"
echo "Sourcing test2.sh"
. ./test2.sh
exit
File 2 (Sourced file):
# cat test2.sh
#!/bin/sh
echo "Running test2.sh - \$0 is $0"
exit
Output:
# ./test.sh
Running test.sh - $0 is ... (1 Reply)
Discussion started by: Vryali
1 Replies
6. Shell Programming and Scripting
I want to run nested loop inside shell script using which I want to copy files on diff machines on round robin basis.Number of machiines is fixed as 4 but number of files may vary. For eg.
Files: f1,f2,f3,f4,f5,f6
Machines: M1,M2,M3,M4
M1 - f1
M2 - f2
M3 - f3
M4 - f4
M1 - f5
M2 - f6
... (1 Reply)
Discussion started by: baig_1988
1 Replies
7. UNIX for Dummies Questions & Answers
I am very new to bash scripting and this is my first script.
I am trying to write a script that takes an argument d as the directory.
It looks through the files to find duplicates and delete them.
Here's some sorta-pseudocode but am unsure how to implement it:
#! /bin/bash
#get... (1 Reply)
Discussion started by: shubham92
1 Replies
8. Shell Programming and Scripting
Hi Team,
Thank you for your time.
i have a situation where the user IDs of the applicatio users have been locked down to Read only.
Hence I am writing a script to invoke their old .profile every time they login.
My problem is : when i run . $userpath/.profile from within the ksh script... (9 Replies)
Discussion started by: anitha111
9 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I am quite new to Linux... I need to set some aliases and I can't get it to work. Can somebody tell me what's wrong?
I modified the .bashrc file in my home directory. I added:
alias pmv= '/home/vera/MGLTools-1.4.5/share/bin/pmv'
saved it and ran source .bashrc
The shell... (3 Replies)
Discussion started by: Nusy
3 Replies
10. Shell Programming and Scripting
hi,
Am trying to compare to files using the 'for' loop have tried this but keeps going on and on..
#!/bin/bash
for i in $(cat $c.sh);
do
for j in $(cat $d.sh);
do
if test "$i" != "$j"
then echo $i not in $j
fi
done
done
have tried this as... (0 Replies)
Discussion started by: vadharah
0 Replies