10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can I cut the date and leave it in 3 variable?
date="20181219"
year=substr(date,1,4)
monthsubstr(date,4,2)
daysubstr(date,6,2)
result
year=2018
month=12
day=19
this does not work for me (3 Replies)
Discussion started by: tricampeon81
3 Replies
2. UNIX for Beginners Questions & Answers
I have a file abc.txt which has records like
456 /home/fgg/abdc.txt
3567 /home/fdss/vfgb.txt
23 /home/asd/dfght.txt
I WANT TO REMOVE STRING UNTIL 3RD OCCURANCE OF FORWARD SLASH
Output should be like
abdc.txt
vfgb.txt
dfght.txt (5 Replies)
Discussion started by: himanshupant
5 Replies
3. UNIX for Dummies Questions & Answers
In a SCO Unix shop, I am working on the following script to move any file to its same location on the target machine (called 'othersy' here):
pwd=`pwd`
for i in "$@"
do
echo " $i "
if ; then echo 1; else echo 0; fi
rcp -p $i othersy:$pwd/$i
echo "Finished with ^ If I find a file... (4 Replies)
Discussion started by: wbport
4 Replies
4. Shell Programming and Scripting
Hi,
I need a script which do below
I have a filename: TEST2013_09_17_XX_XX_XX.csv
Now script should create a new file with name: XX_XX_XX.csv
Or I should say i need the output as XX_XX_XX.csv
Please help. Mant thanks in advance (3 Replies)
Discussion started by: sv0081493
3 Replies
5. Shell Programming and Scripting
Dear UNIX Community,
I have a set of file paths like the one below:
\\folder name \ folder1 \ folder2 \ folder3 \ folder4
\\folder name \ very long folder name \ even longer name
I would like to find the length of the characters (including space) between the \'s. However, I want... (6 Replies)
Discussion started by: vnayak
6 Replies
6. Shell Programming and Scripting
I have an interesting one for the gurus out there that may have an idea as to why this is happening. We're currently migrating from Solaris 9 to Solaris 10 and we've run into a very strange issue. There are a bunch of shell scripts people have written throughout a directory that are used for... (4 Replies)
Discussion started by: dcarrion87
4 Replies
7. Shell Programming and Scripting
Hi all,
I'm trying to extract string from variable in BASH. That's probably trivial for grep but I couldn't figure it out.
I want to get name, there's sometimes digit after it, but it should be left out.
STRING=http://name5.domain.com:8000/file.dat
Could someone help me with that?
Any... (10 Replies)
Discussion started by: cootue
10 Replies
8. Shell Programming and Scripting
hi
I have a list of words in a text file. these words are appended by "." at their end. They look something like this.
word1.
word2.
word3.
word4.
word5.
I need to remove the last character "." from all the words. The output must look something like this.
word1
word2
word3... (7 Replies)
Discussion started by: ss3944
7 Replies
9. Shell Programming and Scripting
Hi all,
I need to know way of inserting backward slash before forward slash. My problem is that i need to supply directory path as an argument while invoking cshell script. This argument is further used in script (i.e. sed is used to insert this path in some file). So i need to place \ in front... (2 Replies)
Discussion started by: sarbjit
2 Replies
10. Shell Programming and Scripting
Hi All,
I have a string like "9633C01302_2". I need to extract the number(02) after "13" and before "_" and the number coming after "13" and before "_" is not constant, it keeps on changing...
Can some one plz help me wth the command..
i tried this echo "9633C01302_2" | cut -d'_' -f1 ..But... (2 Replies)
Discussion started by: grajesh_955
2 Replies