10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i need to be able to count the number of single quotes ' in the entire string below:
"description":"DevOps- Test VM's, System Admins Test VM's ",
awk can most likely do this, but here's my attempt using egrep:
echo "${STRING}" | egrep -wc '"'"\'"'"'
or
echo "${STRING}" | egrep -wc... (11 Replies)
Discussion started by: SkySmart
11 Replies
2. Shell Programming and Scripting
Hi Froum.
I have tried in vain to find a solution for this problem - I'm trying to replace any double quotes within a quoted string with a single quote, leaving everything else as is.
I have the following data:
Before:
... (32 Replies)
Discussion started by: pchang
32 Replies
3. Shell Programming and Scripting
Hi,
Trying to change the prompt. I have the following code.
export PS1='
<${USER}@`hostname -s`>$ '
The hostname is not displayed
<abc@`hostname -s`>$ uname -a
AIX xyz 1 6 00F736154C00
<adcwl4h@`hostname -s`>$
If I use double quotes, then the hostname is printed properly but... (3 Replies)
Discussion started by: bobbygsk
3 Replies
4. Shell Programming and Scripting
Hello. I'm trying to write a bash script that uses GNU screen and have hit a brick wall that has cost me many hours... (I'm sure it has something to do with quoting/globbing, which is why I post it here)
I can make a script that does the following just fine:
test.sh:
#!/bin/bash
# make... (2 Replies)
Discussion started by: jondecker76
2 Replies
5. Shell Programming and Scripting
Hi I want to replace single quote with two single quotes in a perl string.
If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Discussion started by: DushyantG
3 Replies
6. UNIX for Dummies Questions & Answers
Unix superusers,
I am new to unix but would like to learn more about grep. I am very familiar with regular expressions as i have used them for searching text files in windows based text editors. Since I am not very familiar with Unix, I dont understand when one should use GREP with the... (2 Replies)
Discussion started by: george_vandelet
2 Replies
7. Shell Programming and Scripting
Consider the following script:
#!/bin/bash
exclude='Archive PST,SystemState'
IFS=$","
rsyncExclusions=$(for exclude in ${exclude}; do echo -n -e --exclude=\"${exclude}\"\ ; done)
unset IFS
echo rsync $rsyncExclusions test
rsync -avh --delete --delete-excluded "$rsyncExclusions"... (7 Replies)
Discussion started by: jelloir
7 Replies
8. Shell Programming and Scripting
Hi,
I am trying to create a script which validates the incoming source files. The script has File name Pattern as Argument. The First part of the script validates if there are any files available
if
then
echo "\n Files are available to process \n"
else
echo "\n File does not... (9 Replies)
Discussion started by: dsshishya
9 Replies
9. UNIX for Dummies Questions & Answers
Hi All, I love this site, it helps newbie people like me and I appreciate everyone's help!
Here is my questions.
I am trying to concatenate a single quote into a character/string from a text file for each line (lets say ABC should look like 'ABC').
I tried to use awk print command to do... (1 Reply)
Discussion started by: mrjunsy
1 Replies
10. Shell Programming and Scripting
I'm not very familiar with the ssh command. When I tried to set a variable and then echo its value on a remote machine via ssh, I found a problem. For example,
$ ITSME=itsme
$ ssh xxx.xxxx.xxx.xxx "ITSME=itsyou; echo $ITSME"
itsme
$ ssh xxx.xxxx.xxx.xxx 'ITSME=itsyou; echo $ITSME'
itsyou
$... (3 Replies)
Discussion started by: password636
3 Replies