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
Hello friends/'unix experts',
i have a file as below
cat sample.txt
satish
/rakesh/
sandhya
/sandeep/
i have to replace /rakesh/ with rakesh, how can i do it with sed, i tried below code but its throwing errors
sed -e 's/'"\(/rakesh/)\"'/\1rakesh/g' sample.txt
... (1 Reply)
Discussion started by: only4satish
1 Replies
5. UNIX for Dummies Questions & Answers
I have text file which is a tab delimited one. Sample data from the file is shown below:
unix is\ great\ os
linux\ is superb
I want to replace that backslash with empty string preserving the tab delimiter. Output should be
unix is great os
linux is ... (3 Replies)
Discussion started by: p.akhilreddy4u
3 Replies
6. Shell Programming and Scripting
If I echo "\\" I get a backslash returned
~$ echo "\\"
\
Why doesn't this work:
string=`echo "\\"`
echo $string
I get the error message:
bash: command substitution: line 1: unexpected EOF while looking for matching `"'
bash: command substitution: line 2: syntax error: unexpected end... (2 Replies)
Discussion started by: locoroco
2 Replies
7. Shell Programming and Scripting
Dear
I have one problem in SCO Unix command line.
I want to disable execution of commands with backslash.
For example - if the user executes the following command
\exec_script
Here - i want the system should NOT execute this command.
Can any one give me a suitable... (8 Replies)
Discussion started by: subbu62
8 Replies
8. UNIX for Dummies Questions & Answers
When I run my script in debug mode I see that \ is not getting executed as part of command. It is being treated as escape character.
find ${DATABASE_PARAM_PATH} -mtime +${RETENTION_PERIOD} -exec rm -rf {} \;
Command execution output in debug mode :
find... (1 Reply)
Discussion started by: findprakash
1 Replies
9. UNIX for Dummies Questions & Answers
I want to execute something like this:
find . -type f -regex '$REGEX' -print | xargs split -d -C $SIZE
The problem is that I want the name of the split files to be the same name as original files. So if my directory has two files called abc.txt and def.txt, then I want the split files to be... (1 Reply)
Discussion started by: namityadav
1 Replies
10. Shell Programming and Scripting
Hi, I'm running into following issue, my_file is a collection of windows directories (i.e \\path\directory\file) . I need to be able to execute "my command" as
my command \\path\directory\file
I know that while read -r / print -r ignores backslashes.
My code:
cat $my_file | while read -r... (6 Replies)
Discussion started by: agalkin
6 Replies