10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have defined a function ln_s() for customizing the ln command in script1.sh.
more script1.sh
echo "Starting Execution"
./script2.sh
echo "End of Execution"
ln_s(){
] && return
ln -s "$1" "$2"
}
My script1.sh executes another script2.sh which has the following entry
more script2.sh... (12 Replies)
Discussion started by: mohtashims
12 Replies
2. Shell Programming and Scripting
Hi,
maybe I'm asking a VERY dumb question, but would anybody out there tell me, why this f****** script won't work if executed as a cronjob, but works fine if executed from a shell prompt?
#! /bin/bash
set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
date >>... (3 Replies)
Discussion started by: beislhur
3 Replies
3. Shell Programming and Scripting
Hello all,
How can I invoke the bash shell (via command line) to execute another command by setting an exported environmental variable on the fly (as this env var would be used by the command -another script, the bash would execute).
This needs to be done in one single line as the same would... (4 Replies)
Discussion started by: Praveen_218
4 Replies
4. Shell Programming and Scripting
Hi All,
I have to pick particular segments from a file and I have prepared below shell script.But its not working and I am not able to find out whats the issue.could you guys pls help?
Sample file:
TS3*1451575*12*20151231*4*482.44
NM1*QC*1*CUTLER*BETTY
DTM*472*20150808... (4 Replies)
Discussion started by: Venkata Prasad
4 Replies
5. Shell Programming and Scripting
None of the aliases that I set are available if I switch to a different shell.
How can I export aliases and make them available in any shell that I switch to like ksh or bash ?
I tried these
$>alias godata='cd /home/kc/app/data'
$>alias -x godata='cd /home/kc/app/data'
$>alias |... (2 Replies)
Discussion started by: kchinnam
2 Replies
6. Shell Programming and Scripting
Hi, I am trying to do this thing useing my shell bash ( sorry for my english )
I have in a file 63 hostnames, i wanna ask to the DHCP admin, to reserv that reserves 63 IP addresses of this hosts, using their mac address.
I have thinked this script:
for ((i=1;i<63;i++)); do
arp $(head... (10 Replies)
Discussion started by: Cypress
10 Replies
7. UNIX for Dummies Questions & Answers
It is happening with my sessions already second time: a 'for'-loop for some reason stop to work as expected.
That means or it is looping without exitting, or it is not loop even once.
Here example of my try when it is not processing even one loop.
You can see, I start new subshell and... (14 Replies)
Discussion started by: alex_5161
14 Replies
8. Shell Programming and Scripting
i have this code for a simple if loop:
#!/bin/bash
array="1 2 3 4 5"
array2="5 6 7 8 9"
if } -gt ${array} ]; then
echo "${array2} is greater than ${array}!!"
fi
the error is
./script8: line 9: [: too many arguments
./script8: line 9: [: too many arguments
./script8: line 9: [:... (10 Replies)
Discussion started by: npatwardhan
10 Replies
9. UNIX for Dummies Questions & Answers
Everything else seems to be working, but this isn't. Is it the "cat..." that is wrong of the condition? Thanks.
cat tc_result.txt | while read LINE
do
if
then
let "files_run += 1";
echo "inside the if loop"
# save current filetype
case $LINE... (5 Replies)
Discussion started by: brdholman
5 Replies
10. Shell Programming and Scripting
I am exporting data using a shell program. I am getting all of the records instead of getting a subset based on my query. The export_problem.par lists all of my tables. I tried the query with the ' and without it. How do I get the export to use the query?
Thanks!
... (1 Reply)
Discussion started by: GEBRAUN
1 Replies