10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello.
I can use any particular (stupid or not) format when using bash date command.
Example :
~> date --date "now" '+%Y-%m-%d %H!%M!%S'
2019-06-03 12!55!33or
~> date --date "now" '+%Y£%m£%d %H¤%M¤%S'
2019£06£03 12¤57¤36
or
~> date --date "now" '+%Y-%m-%d %H-%M-%S'
2019-06-03 12-58-51
... (4 Replies)
Discussion started by: jcdole
4 Replies
2. Shell Programming and Scripting
Hi All,
How to validate the 4th column,it is date column in the file, if it valid move to valid file else moved invalid file.
9f680174-cb87|20077337254|0|20120511|N
9f680174-cb88|20077337254|0|20120534|N
i want two file valid.txt and invalid.txt
Thanks, (7 Replies)
Discussion started by: bmk
7 Replies
3. UNIX for Dummies Questions & Answers
Hi Guys,
Good morning! I have a file which looks something like this:
Command was launched from partition 0.
------------------------------------------------
Executing command in server server3
Thu Jan 12 11:10:39 EET 2012
------------------------------------------------... (3 Replies)
Discussion started by: rymnd_12345
3 Replies
4. Shell Programming and Scripting
Hi
I have some set of files for a particular date. What is the command that I need to put in for finding the total size of all the files for that particular date. The following command is fetching me the size of all individual files seperately
du -h *20101010*
16M file1.20101010
120K... (10 Replies)
Discussion started by: bobby1015
10 Replies
5. Shell Programming and Scripting
I have a ksh script and would like to validate a MAC address that is input by the user:
00:14:4F:FC:00:49
example:
MAC=`/usr/bin/ckint -p "Enter MAC address"`
echo $MAC
echo " "
Obviously chkint will not work, but does anyone have any suggestions?
Thanks (9 Replies)
Discussion started by: hxman
9 Replies
6. Shell Programming and Scripting
Hi,
I am passing date string of format 'YYYYMMDD' to a ksh script.
Will I be able to get next valid date from the passed in string.
Example I pass '20100228' to the shell script, Is there a reverse date command to get '20100301' .i.e to convert '20100228' to date and get next date.... (5 Replies)
Discussion started by: bittoo
5 Replies
7. Shell Programming and Scripting
Hi,
I have a cron process that runs daily and generates a log file. The process writes the date it ran and also any errors to the log file.
I need to write a script that will check if the process ran yesterday and also look for the keyword 'ERROR'. If it did not run yesterday or if it found... (0 Replies)
Discussion started by: tatchel
0 Replies
8. UNIX for Dummies Questions & Answers
How would I go about getting the previous date on the server? I'm out of ideas...I am thinking that I could do it using the date command, but I am unable to find any information on doing it. For example if the current date is April 17th 2008 it would be (20080417) <- (YYYYMMDD). I need the previous... (4 Replies)
Discussion started by: developncode
4 Replies
9. Shell Programming and Scripting
I'm using the following in my script.
if echo $cpuidle |/usr/bin/egrep ; then
when I issue this statement it issues the value of the variable back to stdout which ends up in my output file.
Is there a better way to write this?
I'm using ksh on solaris 9. (3 Replies)
Discussion started by: MizzGail
3 Replies
10. Shell Programming and Scripting
Hi i am using a shell script for renaming the files and placing in the remote location(FTP) my code is:
cd $1
day=$(date +%d)
for i in `ls -1 BBW*`
do
last=`tail -1 $i`
pat=`expr "$last" : '.*(\(.*\)).*'`
pat=`echo $pat | sed 's/ /_/'`
pat=$pat$day
mv $i $pat
rm -f $day
done... (3 Replies)
Discussion started by: srivsn
3 Replies