10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a loop with cases
I am working on Bourne shell
for file in *.${Today}*.csv *.${Today}*.txt\
do
case ${file} in
sun_detail)
do something
;;
sum)
do something
;;
mod)
do something
;;
*)
do something
;; (5 Replies)
Discussion started by: digioleg54
5 Replies
2. 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
3. Shell Programming and Scripting
Dear all Linux lover,
I am a new learner to Bash Shell script and I would like to writing a script to to repeat my script.
This mean I would like to have multiple same of result after running the .sh.
#######
TIMES_NO=0
echo -n "Please enter the number for times to repeat ?"
read... (10 Replies)
Discussion started by: Rocky888
10 Replies
4. Shell Programming and Scripting
Hi
I'm using this script to transcode videos in an Ubuntu 12.04 machine.
#! /bin/bash
MOVDIR="/media/topaz_1/media/transcodes/transcode_mov/"
MOVDESTDIR="/media/topaz_1/media/transcodes/final_mov/"
DONEFILESDIR="/media/topaz_1/media/transcodes/dv_cache/"... (1 Reply)
Discussion started by: oscarfelson
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am using a for loop to manipulate files data_1.txt through data_100.txt. The for-loop is set up like this:
for i in {1..100}; do cut -f1 data_$i.txt > output$i.txt
I get the following error message when I run the code:
cannot open `data.txt' for reading: No such file or directory... (4 Replies)
Discussion started by: evelibertine
4 Replies
6. Shell Programming and Scripting
Hi,
I am trying to run the factorial script but it’s not working.
The code is mentioned below:
------------------------------------------------------------------
/home/gc> cat fact.sh
#!/bin/bash
# using one command line parameter
factorial=1
for (( number = 1; number <= $1 ;... (3 Replies)
Discussion started by: Technext
3 Replies
7. Shell Programming and Scripting
Hi Friends,
I am presently migrating shell scripts writter in KSH to SH.I am stuck at this place and i am not able to find a work around:-
Let the script name is x.sh
Below are some of the codes in it...
export abc=hello
export abc=hi
export abc=how
When i am trying to compile the script ... (6 Replies)
Discussion started by: amit.behera
6 Replies
8. Shell Programming and Scripting
Hi-
Here is the shell script that for some reason is not returning results:
#! /bin/ksh -
avg() {
AVG=0
typeset SUM=0
if
then
echo "You must have at least two numbers"
else
for NUM in "$*"
do
... (2 Replies)
Discussion started by: koomba
2 Replies
9. 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
10. 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