10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a variable LOGNUM with values 0000095, When i subtract the variable by 1, Its losing its leading zeros. Can you please help me here ?
LOGNUM=0000095
$OLDLOG=`echo "${LOGNUM}-1"|bc`
$ echo $OLDLOG
94
Am expecting output as
0000094
Appreciate your help!
Thanks,... (11 Replies)
Discussion started by: prince1987
11 Replies
2. Shell Programming and Scripting
Dear All,
assume i have a file with content:
<Start>6000</Start>
<Stop>7599</Stop>
the output is:
6000
7000
7100
7200
7300
7400
7599
how should we use any awk, sed, perl can do this task, means to extract the uniq prefixes from the start and stop prefix.
Thanks
Jimmy (3 Replies)
Discussion started by: jimmy_y
3 Replies
3. Shell Programming and Scripting
I am using the below curl command to download a single file from client server and it is working as expected
curl --ftp-ssl -k -u ${USER}:${PASSWD} ftp://${HOST}:${PORT}/path/to/${FILE} --output ${DEST}/${FILE}
let say the client has 3 files hellofile.101, hellofile.102, hellofile.103 and I... (3 Replies)
Discussion started by: r@v!7*7@
3 Replies
4. Shell Programming and Scripting
Possible filenames:
CDD_Whatever.txt
DDD_Whatever.txt
If the file prefix = CDD, I'd like to prefix every person ID (second column in my examples below) on the file with "c-"
If the file prefix = DDD, I'd like to prefix ever person ID with "d-"
Input:
Desired Output:
Any help... (2 Replies)
Discussion started by: lrluis
2 Replies
5. Shell Programming and Scripting
In PERL script
I have few files named theme1.htm,theme2.htm,theme3.htm and so on.
now I need to write perl code to split the the filename and store only that particular digit.
Example
--------------
filename is theme1.htm
output should be 1
another example
---------------... (5 Replies)
Discussion started by: giridhar276
5 Replies
6. Shell Programming and Scripting
Hello,
I have the string "/a/b/c/ddd.txt" and i want to get only the filename, in this case "ddd.txt". I have as something known in the script the pattern "/a/b/c/", so I`ve tried something like:
echo "/a/b/c/ddd.txt" | cut -d "/a/b/c/" -f2
but it doesn`t go, any help?.
thanks,
bye (2 Replies)
Discussion started by: rubber08
2 Replies
7. UNIX for Dummies Questions & Answers
Hello,
Hello,
I use the following command to split a file:
split -Number_of_Lines Input_File MyPrefix_
output is
MyPrefix_a
MyPrefix_b
MyPrefix_c
......
Instead, how can I get numerical values like:
MyPrefix_1
MyPrefix_2
MyPrefix_3
...... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies
8. UNIX for Dummies Questions & Answers
In unix when I run rm command, it asks for file removal confirmation e.g.
rm netmail_log.csv
rm: remove netmail_log.csv (yes/no)? n
But if i prefix backslash to rm it does not ask for confirmation. Does anyone know what backslash does to command or shell ?
e.g.
\rm netmail_log.csv (1 Reply)
Discussion started by: Devdatta
1 Replies
9. AIX
I need help to split a filename 'a0crk_user:A0-B0123$#%test' into a0crk_user and A0-B0123 and print the output under 2 different columns namely
User and Status.
for eg. the output should like below:
User Status
---- ------
a0crk_user A0-B0123 (3 Replies)
Discussion started by: mbak
3 Replies
10. UNIX for Dummies Questions & Answers
I've got a bunch of files called oldabc, olddef etc.
i want to copy these to be abc, def....
I can do this with file extensions....but can get the logic to work for prefixes. All the files I am interested in have a prefix of 'old'.
This loop is no good for me....it looks at the content... (2 Replies)
Discussion started by: peter.herlihy
2 Replies