hi,
Is there a way to access the redirected file inside the script. Here is what the command line looks like:
$ shar * > archive_file.arc
I know I can't access the name of archive_file.arc with positional parameters like $1, $2.. Is there any way to figure out what file the output of the... (3 Replies)
I have a file (email) containing email addresses.
I have a second file (terms) that contains simple regular expressions and words/characters. Here are some examples:
\.trainee
\.group
\.web
I want to go through email and delete lines containing the expressions/words from terms and write... (1 Reply)
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Hi All,
I have some files in my directory, and i want to pull all data using for loop....I am using following code but getting error..!
for file in {file1, file2, file3, ..... filen}
do
L="$(tail -1 $file)";NUM=${L%%|*};DAT=${L##*|}
echo $NUM>>filedata.txt
done
Error:
tail:... (3 Replies)
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Hi all,
Here is an outline of the problem:
#variable declared at start of script
x=0;
#a function that increments x by 1 every 10 seconds
incrementX(){
increments x every 10 seconds;
}
#i want this to output the value of x every second. The problem is that x is always reported... (3 Replies)
Hi ,
I'm trying to move/copy the files inside the loop into a directory .
I tried the below code and the issue is the data is not copying into the created directory but the files are copying into another file
file_path="/home/etc"
Last_Day=20130930
mkdir $file_path/ARC_${Last_Day}
... (3 Replies)
Hi Guys,
I need to access multiple directories whcih is following similar structure and need to copy those files in desitination path.
for eg :
if ]
then
cd ${DIR}/Mon/loaded
echo "copying files to $GRS_DIR"
cp * ${DIR}/Mon/
echo "Files of Monday are Copied"
fi
if ]
then... (5 Replies)