Hi,
In my shell script I use the following code to copy files from one directory to other.
I would like to add logic that before copy happens I would like to check if the file name has any spaces in it. If it has space then I would like to abort the process.
The reason why I want to abort is in next part of shell script I remove/delete files based on looping on output of ls command and having a space might create unneccessary problems.
Help is appreciated to modify the above code to abort if space is found in the file name.
I have a little bash script that includes make to compile with g++ and then a statement to actually run the compiled program. When it (the script) gets a syntax error, it does not abort and continues to run the previous version of the program.
How can I make the script abort when g++ generates a... (1 Reply)
I'm running Red Hat Linux 2.6.7 on a x86_64 box.
I have a core file from a program that called abort(). Does anyone here know how can I get a backtrace? (Re-creating the error with svd running inside gdb has proved impossible).
% gdb svd core.25223
GNU gdb Red Hat Linux... (2 Replies)
Hi,
I would like to know given executing a file with inputs, I would like to know when does it terminate /abort abnormally.
I tried to append an echo $? after executing my program which is in C. However, there is nothing..It shows 0 even though the program actually exit.
my command is... (1 Reply)
I am calling SQL script in my UNIX Shell script and trying to create the CSV file and my last column value of each row is 23 blank spaces.
In my SQL script,the last column is like below.
RPAD(' ',23,' ') -- Padding 23 blank Spaces
The CSV file is generated but the sapce(23 spaces) is... (2 Replies)
Below is my shell script from which I am trying to invoke few Hive SQL queries and the below shell script works fine.
Problem Statement:-
If you see my first `hive -e` block in the below shell script which contains a very long Hive SQL query. Sometimes that Hive SQL query gets failed due to... (1 Reply)
Hi All,
I have a requirement where if Source Count is not equal to Target count, then I need to exit/abort the script and come out. Then send an email to thummi@email.com saying "RECORD COUNT DOES NOT MATCH. Please need your help.
Here is what I have written : If even the count is not... (1 Reply)
I have below file. I want to remove space at begining of every line and then after also remove blank line from file.
I use below code for each operation.
sed -e 's/^*//' < check.txt > check1.txt
sed '/^\s*$/d' < check1.txt > check2.txt
above code not remove all the space... (12 Replies)
I want to abort script if input variable matched first field in any line of a file.
#!/bin/sh
read INPUTVAR1
awk "{if(\$INPUTVAR1 == $1) x = 1} END {if(x==1) print \"I want to abort script here\"; else print \"OK\"}" /etc/some.conf
I tried "exit" and system("exit") but no luck. (1 Reply)
Gents,
I have a script which will run others scripts .
Example
#!/bin/bash
script1
script2
script3
script4
I would like to stop all process if any of the script got errors?. If for example script1 works fine will continue script2, then if the script2 got errors, The bash should... (2 Replies)