Sponsored Content
Full Discussion: substring a date
Top Forums UNIX for Dummies Questions & Answers substring a date Post 302706727 by lillyt2006 on Thursday 27th of September 2012 09:17:53 AM
Old 09-27-2012
Thank you for the explanation. It is clear and helps me in my understanding with unix.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

substring

Hi, I've got a UNIX-script in which a variable 'name' is used. This variable is filled with a filename (e.g. file.tst). Now I want to search for files which start with the same name, but without the extension, e.g. file_test. Is there a way of doing this, using something like substring or... (4 Replies)
Discussion started by: Anika
4 Replies

2. Shell Programming and Scripting

How do I Substring ??

Hello everyone. I'm writing a script in UNIX. The purpose is to get the second character from a variable that stores the system year. This is the code: unix_year_yy=`date "+%g"` This will return "07" in variable unix_year_yy. How can I get the second character (7)?? (6 Replies)
Discussion started by: Rigger
6 Replies

3. Shell Programming and Scripting

Again Substring!!!! Help

Hi, To remove the date and time from the below data which is in a file abc.txt 29 Jul 2009 04:36:53,956 ERROR 1 Error with Java 29 Jul 2009 04:36:58,335 ERROR 2 29 Jul 2009 05:37:24,746 ERROR 3 I want the output as ERROR 1 Error with Java ERROR 2 ERROR 3 As, In the above... (2 Replies)
Discussion started by: Pank10
2 Replies

4. UNIX for Dummies Questions & Answers

Substring

Hi I use the below cmd to get the list of files that are modified than <temp> file in the <path> diretory cmd:find <path> -name '*.zip' -type f -newer <temp> -print i am getting all the list of files that are new or modified, with abs path, i want to copy all of these files to a... (3 Replies)
Discussion started by: Naveen_5960
3 Replies

5. Shell Programming and Scripting

Get the substring

Hi All, I have a ouput string likes 'u8wos' or 'u10acsd' or somthing else 'u{number}{any characters}'and I want to get the number behind the letter 'u' by bash shell. Thanks Damon (11 Replies)
Discussion started by: Damon_Qu
11 Replies

6. Shell Programming and Scripting

Date One Week Ago From Given Date, Not From Current Date

Hi all, I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date. So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
Discussion started by: Donkey25
4 Replies

7. Shell Programming and Scripting

Converting a date to friday date and finding Min/Max date

Dear all, I have 2 questions. I have a file with many rows which has date of the format YYYYMMDD. 1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too. 2. After converting the date to... (10 Replies)
Discussion started by: 2001.arun
10 Replies

8. UNIX for Dummies Questions & Answers

Get date, change format and substring?

I'm somewhat new to shell scripting and I have a file that had a date in it. /somedirectory/datefile.txt I want to take the date in the file: 2013-06-12 and change the formate to 20130612 and have it as a variable/parm I also what to take that date 2013-06-12 and substring it. I know... (3 Replies)
Discussion started by: MJCreations
3 Replies

9. Shell Programming and Scripting

Date substring from a string

Hi, I have 2 statements in a file a.sh start time is Fri Jan 9 17:17:33 CST 2015 a.sh end time is Fri Jan 9 17:47:33 CST 2015 I am required to get only the time out of it. like 17:17:33 & 17:47:33 PLs suggest (21 Replies)
Discussion started by: usrrenny
21 Replies

10. Shell Programming and Scripting

Date: invalid date trying to set Linux date in specific format

i try to set linux date & time in specific format but it keep giving me error Example : date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" or date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" keep giving me this error : date: invalid date ‘19-01-2017 00:05:01' Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies
STRSTR(3)						     Linux Programmer's Manual							 STRSTR(3)

NAME
strstr - locate a substring SYNOPSIS
#include <string.h> char *strstr(const char *haystack, const char *needle); DESCRIPTION
The strstr() function finds the first occurrence of the substring needle in the string haystack. The terminating `' characters are not compared. RETURN VALUE
The strstr() function returns a pointer to the beginning of the substring, or NULL if the substring is not found. BUGS
Early versions of Linux libc (like 4.5.26) would not allow an empty argument. Later versions (like 4.6.27) work correctly, and return haystack when needle is empty. CONFORMING TO
ISO 9899 SEE ALSO
index(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strsep(3), strspn(3), strtok(3) GNU
1993-04-12 STRSTR(3)
All times are GMT -4. The time now is 05:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy