I am getting the following upon cat a file which is not present in directory.
"cat: cannot open test1.txt"
I need to process files and I want that this message should be suppressed. thx
When you run your script, run it as '/path/to/script 2>/dev/null'. This means that all the stuff that would be written to standard error is to be redirected to /dev/null.
No, it means when you run your script, add the exact text below right after the name of the script, before you press 'enter' on the command line.
If your script is named "x.sh" , then when you run it, type "x.sh 2>/dev/null".
I am getting the following upon cat a file which is not present in directory.
"cat: cannot open test1.txt"
I need to process files and I want that this message should be suppressed. thx
Hallo,
I wrote some script:
95% of the script's output consists of error messages like "mkdir: cannot create directory ‘final': File exists
Exit 1" and "rm: No match. Exit 1".
These messages are not harmful at all, but they make the output almost unreadable.
How can I get rid of... (5 Replies)
I have a file containing data in multiple columns. The colums are seperated by pipe (|). I need to extract information as below:
myfile_20130929_781;10;100.00
where myfile.txt is the file name. 10 is the number of records in the file starting with 120 and 100.00 is the sum of 26th field of... (16 Replies)
HI ,
I am tryin to copying multiple files from some dir. If the files are not present. It should not throw error in the screen. HOw to do that . Please help (4 Replies)
Hi All
this is a simple script
#! /bin/bash
FileCnt=`ls -lrt $DIR/* | wc -l`
echo $FileCnt
how could i escape the error msg if there are no files in $DIR
ls: /home/sayantan/test/files/cnt/*: No such file or directory
0
Looking forward for a quick reply
Regards, Newbie... (3 Replies)
I'm creating a bsh shell to unzip a file from one directory into another. The directory that holds the zip files has zip files constantly being added to it, so I am testing it before it does the unzip and more.
Right now my code looks like this:
unzip -tq $ZIP_PATH/$ZIP_NAME >/dev/null
if ... (5 Replies)